General Function Syntax

Aggregate Function Syntax

The syntax for an aggregate function is
aggregate-function (expression)

aggregate-function

specifies the name of the function.

expression

specifies an expression that evaluates to a column name. The expression can include one of the following forms:

table.column

is a qualified column that identifies the table that is being processed by the FedSQL statement followed by a period and the name of the column.

Example
select avg(densities.density)from densities;

column

is an unqualified column name that has an implicit table qualifier. The implicit table qualifier is the table that FedSQL is processing.

Example
select avg(density)from densities;
Note: You can specify more than one argument for some aggregate functions. If you do, the Base SAS function is used and the functions can no longer be considered an aggregate function. For more information, see Calling Base SAS Functions Instead of FedSQL Aggregate Functions.

Non-Aggregate Function Syntax

The syntax of a function is
function (argument [, ...argument])

function

specifies the name of the function.

argument

can be a variable name, constant, or any FedSQL expression, including another function. The number and type of arguments that FedSQL allows are described with individual functions. Separate multiple arguments by a comma.

Examples
select sqrt(1500);
select ifnull(AvgHigh, 0) from worldtemps;