Teradata
Teradata {account} Returns the account string for the current user. add_months ( date_expression|datetime_expression , integer_expression ) Returns the date or the datetime resulting from adding "integer_expression" months to "date_expression" or "datetime_expression". bytes ( byte_expression ) Returns the number of bytes contained in "byte_expression". "Byte_expression" is restricted to BYTE or VARBYTE. concat ( string_expression1 , string_expression2 ) Returns a string that is the result of concatenating, or joining, "string_expression1" to "string_expression2". Example: concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales staff].[Last name] ) Result: Returns the first name and family name; e.g., Bob Smith. {database} Returns the name of the default database for the current user. {date} Returns the current date. characters ( string_expression ) Returns an integer value representing the number of logical characters or bytes contained in "string_expression". case_n ( condition_expression_list [ , NO CASE|UNKNOWN|NO CASE OR UNKNOWN [ , UNKNOWN ] ] ) Evaluates "condition_expression_list" and returns the position of the first true condition, provided that no prior condition in the list evaluates to unknown. The keywords must be enclosed in curly brackets. No case is an optional condition that evaluates to true if every expression in the list evaluates to false. No case or unknown is an optional condition that evaluates to true if every expression in the list evaluates to false, or if an expression evaluates to unknown and all prior conditions in the list evaluate to false. Unknown is an optional condition that evaluates to true if an expression evaluates to unknown and all prior conditions in the list evaluate to false. char2hexint ( string_expression ) Returns the hexadecimal representation for "string_expression". coalesce coalesce ( expression_list ) Returns the value of the first non-null argument in "expression_list". The coalesce function must have at least two expressions. If all arguments evaluate to null, it returns null. Example: coalesce ( [Unit price], [Unit sale price] ) Result: Returns the unit price, or the unit sale price if the unit price is null. index ( string_expression1 , string_expression2 ) Returns the starting position of "string_expression2" in "string_expression1". The value 0 is returned when "string_expression2" is not found in "string_expression1". The value 1 is returned if the "string_expression2" is found at the first position of "string_expression1". index ( 'The black horse jumped over the black sheep.', 'black' ) Result: 5 index ( 'The black horse jumped over the black sheep.', 'The' ) Result: 1 index ( 'The black horse jumped over the black sheep.', 'green' ) Result: 0 left ( string_expression , integer_expression ) Returns the leftmost "integer_expression" characters of "string_expression". Example: left ( [Sales (query)].[Sales staff].[Last name] , 3 ) Result: Returns the first three characters of each family name. log ( numeric_expression ) Computes the base 10 logarithm of "numeric_expression". "Numeric_expression" must be a non-zero, positive, numeric expression. format ( expression ) Returns the declared format for "expression" as a variable character string of up to 30 characters. month ( date_expression ) Returns the month portion of "date_expression". nullif ( scalar_expression1 , scalar_expression2 ) Returns null if "scalar_expression1" and "scalar_expression2" are equal. Otherwise, it returns "scalar_expression1". "Scalar_expression1" and "scalar_expression2" can be any data type. nullifzero ( numeric_expression ) If "numeric_expression" is zero, converts it to null to avoid division by zero. {profile} Returns the current profile for the session or null if none. random ( lower_bound , upper_bound ) Returns a random integer number for each row of the results table. "Lower_bound" and "upper_bound" are integer constants. The limits for "lower_bound" and "upper_bound" range from -2147483648 to 2147483647 inclusive. "Upper_bound" must be greater than or equal to "lower_bound". range_n ( test_expression between start_expression|start_expression_list|* and end_expression|* [ each range_size [ , no range [ or unknown|, unknown ]|unknown ] ] ) Evaluates "test_expression", maps the result into a list of specified ranges, and returns the position of the range in the list. "Start_expression" and "end_expression" are constant expressions and must be the same data type as "test_expression". An asterisk (*) is used to mark the starting boundary of the first range and indicate the lowest possible value. An asterisk is also used to mark the ending boundary of the last range and indicate the highest possible value. An asterisk is compatible with any data type. "Range_size" is a constant or constant expression. A range that specifies an each phrase is equivalent to a series of ranges. The value of "range_size" must be greater than zero. No range is an optional range to handle a "test_expression" that does not map into any of the specified ranges. No range or unknown is an option that handles a "test_expression" that does not map into any of the specified ranges or a "test_expression" that evaluates to null when range_n does not specify the range between * and *. Unknown is an option that handles a "test_expression" that evaluates to null when range_n does not specify the range between * and *. {role} Returns the current role for the session or null if none. {session} Returns the number of the session for the current user. soundex ( string_expression ) Returns a character string that represents the Soundex code for "string_expression". substr ( string_expression , integer_expression1 [ , integer_expression2 ] ) Returns the substring of "string_expression" that starts at position "integer_expression1" for "integer_expression2" characters. The first character in "string_expression" is at position 1. If "integer_expression2" is omitted, returns the substring of "string_expression" that starts at position "integer_expression1" and ends at the end of "string_expression". Example: substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 ) Result: Returns characters 3 to 7 of the position codes. {time} Returns the current time based on a 24-hour day. According to Teradata documentation, the system function TIME is deprecated. Use CURRENT_TIME function instead. Please note that in Compatible Mode TIME returns time data type, while in Dynamic Query Mode time returns a value of type FLOAT. type ( expression ) Returns the data type defined for "expression". {user} Returns the user name of the current user. vargraphic ( string_expression ) Returns a character string that represents the vargraphic code for "string_expression". year ( date_expression ) Returns the year portion of "date_expression". zeroifnull ( numeric_expression ) Converts data from null to 0 to avoid errors created by a null value. If "numeric_expression" is not null, returns the value of "numeric_expression". If "numeric_expression" is a character string, it is converted to a numeric value of float data type. If "numeric_expression" is null or zero, it returns zero.
Teradata Trigonometry acos ( numeric_expression ) Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine is "numeric_expression". "Numeric_expression" must be between -1 and 1, inclusive. acosh ( numeric_expression ) Returns the inverse hyperbolic cosine of "numeric_expression" where "numeric_expression" can be any real number equal to or greater than 1. asinh ( numeric_expression ) Returns the inverse hyperbolic sine of "numeric_expression" where "numeric_expression" can be any real number. asin ( numeric_expression ) Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is "numeric_expression". "Numeric_expression" must be between -1 and 1, inclusive. atan ( numeric_expression ) Returns the arctangent of "numeric_expression" in radians where the arctangent is the angle whose tangent is "numeric_expression". atan2 ( numeric_expression1, numeric_expression2 ) Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_expression2", respectively, in radians. The returned angle will be between - and π radians, excluding π. atanh ( numeric_expression ) Returns the inverse hyperbolic tangent of "numeric_expression" where "numeric_expression" can be any real number between 1 and -1, excluding 1 and -1. cos ( numeric_expression ) Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in radians. cosh ( numeric_expression ) Returns the hyperbolic cosine of "numeric_expression" where "numeric_expression" can be any real number. sinh ( numeric_expression ) Returns the hyperbolic sine of "numeric_expression" where "numeric_expression" can be any real number. sin ( numeric_expression ) Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in radians. tan ( numeric_expression ) Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed in radians. tanh ( numeric_expression ) Returns the hyperbolic tangent of "numeric_expression" where "numeric_expression" can be any real number.