Function | Description | Standard |
condition(c,a,b) | If c is TRUE (not 0), returns a, otherwise returns b. a and b can be any data type, but c must evaluate to an integer/boolean value. | Centrallix. MySQL uses if(). |
dense_rank(...) | Returns the rank of the current partition (specified by parameters to this function, which can be any type and number) in the result set. Each partition, identified by consecutive unique values specified by the parameters, receives a numerically increasing rank, starting with 1, each time the parameter(s) change. If no parameters are supplied, the rank is 1 for all rows in the result set. | Sybase/MSSQL and MySQL. Other SQLs use an OVER clause instead of parameters. |
eval(s,c) | Treats s as if it were an expression and evaluates it. The optional context c constrains what operations are permitted in s. The context c is a string which can contain C (current object values), P (parent object values), O (arbitrary object values), D (direct path references), S (subqueries), and E (other eval() calls); default is "CPO", which by default blocks the use of direct path references, subqueries, and eval() in the string s. Please use caution with this function - if misused, it could allow a user to evaluate arbitrary expressions in the context of the server, which could compromise security under certain circumstances and configurations. | Centrallix. |
has_endorsement(e,c) | Returns true if the current user has the endorsement (high level permission) e in the context c. | Centrallix. |
isnull(v,d) | Returns v if v is not NULL. If the value v is NULL, returns the default value d instead. | Sybase/MSSQL. MySQL has isnull() but it does something different. In MySQL, use ifnull(). |
lag(v,n) | A window function which returns the value of v from the nth row prior to the current one. n must be a positive integer; v can be any value. | MSSQL and MySQL |
nullif(x,y) | Returns NULL if the values x and y are equal. | Sybase/MSSQL and MySQL. |
octet_length(v) | Returns the length, in bytes (octets) of the data value v, and returns NULL if v is NULL. This function works on any data type. See also char_length() which returns the number of characters in a string. char_length() and octet_length() may differ if the string uses a multibyte character encoding (e.g., UTF-8). | ANSI. Sybase/MSSQL use datalength(), and MySQL uses length(). |
row_number(...) | Returns the sequential number of the row in the partition (group of values) specified by the parameters, which may be any type and number. The row number restarts at 1 when any of the parameters change value. Useful for utilizing the Traveler Algorithm. | MSSQL and MySQL use an OVER clause instead of parameters. |
user_name() | Returns the name of the currently logged in user. | Sybase/MSSQL. MySQL uses current_user(). |