Netezza
Netezza Common Netezza {current_db} {current_db} {current_user} {current_user} {session_user} {session_user} ascii ( string_expression ) Returns a number representing the ASCII code value of the leftmost character of "string_expression"; for example, ascii ( 'A' ) is 65. add_months ( date_expression , integer_expression ) Returns the datetime resulting from adding "integer_expression" months to "date_expression". ceil ( numeric_expression ) Returns the smallest integer greater than or equal to "numeric_expression". char_length ( string_expression ) Returns the number of characters in "string_expression". chr ( integer_expression ) Returns the character that has the ASCII code value specified by "integer_expression". "Integer_expression" should be between 0 and 255. decode ( expr , search , result [ , search , result]... [ , default] ) Compares "expr" to each search value one by one. If "expr" is equal to a search, then it returns the corresponding result. If no match is found, it returns "default". If "default" is omitted, it returns null. initcap ( string_expression ) Returns "string_expression", with the first letter of each word in uppercase, all other letters in lowercase. Words are delimited by white space or characters that are not alphanumeric. instr ( string_expression1 , string_expression2 [ , integer_expression1 [ , integer_expression2 ] ] ) Searches "string_expression1" starting at position "integer_expression1" for the "integer_expression2" occurrence of "string_expression2". If "integer_expression1" is negative then the search is backwards from the end of "string_expression1". Returns an integer indicating the position of "string_expression2". lpad ( string_expression1 , integer_expression [ , string_expression2 ] ) Returns "string_expression1" padded to length "integer_expression" with occurrences of "string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion of "string_expression1" is returned. ltrim ( string_expression1 [ , string_expression2 ] ) Returns "string_expression1", with leading characters removed up to the first character not in "string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB. months_between ( date_expression1 , date_expression2 ) Returns the number of months from "date_expression1" to "date_expression2". If "date_expression1" is later than "date_expression2" then the result will be a positive number. The days and time portions of the difference are ignored, i.e., the months are not rounded, except if "date_expression1" and "date_expression2" are the last days of a month. next_day ( datetime_expression , string_expression ) Returns the datetime of the first weekday named by "string_expression" that is later than "datetime_expression". The return value has the same hours, minutes, and seconds as "datetime_expression". nls_initcap ( string_expression1 [ , string_expression2 ] ) Returns "string_expression1" with the first letter of each word in uppercase and all other letters in lowercase. Words are delimited by white space or characters that are not alphanumeric. "String_expression2" specifies the sorting sequence. nls_lower ( string_expression1 [ , string_expression2 ] ) Returns "string_expression1" with all letters in lowercase. "String_expression2" specifies the sorting sequence. nls_upper ( string_expression1 [ , string_expression2 ] ) Returns "string_expression1" with all letters in uppercase. "String_expression2" specifies the sorting sequence. nvl ( expression1 , expression2 ) Returns the value of "expression1" if "expression1" is not NULL. If "expression1" is NULL, then returns the value of "expression2". Example: nvl ( [Unit sale price] , 0 ) Result: Returns the unit sale price, or returns 0 if the unit sale price is NULL. round ( numeric_expression [ , integer_expression ] ) Returns "numeric_expression" rounded to the nearest value "integer_expression" places right of the decimal point. If "integer_expression" is negative, "numeric_expression" is rounded to the nearest absolute value "integer_expression" places to the left of the decimal point; for example, round (125, -1) rounds to 130. {user} { user } Returns the username of the current Netezza user. rpad ( string_expression1 , integer_expression [ , string_expression2 ] ) Returns "string_expression1" right-padded to length "integer_expression" with occurrences of "string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion of "string_expression1" is returned. If "string_expression2" is not specified, then spaces are used. rtrim ( string_expression1 [ , string_expression2 ] ) Returns "string_expression1", with final characters removed after the last character not in "string_expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not specified, the final space characters are removed. sign ( numeric_expression ) Returns an indicator of the sign of "numeric_expression": +1 if positive, 0 if zero, or -1 if negative. substr ( string_expression , integer_expression1 [ , integer_expression2 ] ) Returns the substring of "string_expression" that starts at position "integer_expression1". The first character in "string_expression" is at position 1. "Integer_expression2" can be used to select fewer characters; by default it selects characters to the end of the string. substrb ( string_expression , numeric_expression1 [ , numeric_expression2 ] ) Returns the substring of "string_expression" that starts at position "numeric_expression1" expressed in bytes. The first byte in "string_expression" is at position 1. "Integer_expression2" can be used to select fewer bytes; by default it selects bytes to the end of the string. to_char ( expression [ , string_expression ] ) Returns the string representation of "expression" with the format of "string_expression". "Expression" can be either a date value or a numeric value. to_date ( expression1 , string_expression2 ) Converts "expression1" to a date value as specified by the format "string_expression2". The first argument "expression1" may be of type string or numeric. to_date ( '2013-02-27' , 'YYYY-MM-DD' ) Result: Returns date with value '2013-02-27'. date_trunc ( string_expression1 , date_expression1 ) Truncates "date_expression1" to a value as specified by the format "string_expression1". date_part ( string_expression1 , date_expression1 ) Returns the "string_expression1" value from "date_expression1". Returns the "string_expression1" value of the database version. version () Converts "string_expression1" to a numeric value as specified by the format "string_expression2". to_number ( string_expression1 , string_expression2 ) Converts "string_expression1" to a timestamp value as specified by the format "string_expression2". to_timestamp ( string_expression1 , string_expression2 ) translate ( string_expression1 , string_expression2 , string_expression3 ) Returns "string_expression1", with all occurrences of each character in "string_expression2" replaced by its corresponding character in "string_expression3". trunc ( numeric_expression1 [ , numeric_expression2 ] ) Truncates digits from "numeric_expression1" using "numeric_expression2" as the precision.
Netezza Math log ( [numeric_expression1 ,] numeric_expression2 ) Returns the logarithm of "numeric_expression2" to the base "numeric_expression1". When the optional argument "numeric_expression1" is not specified, the base 10 is used.
Netezza Trigonometry acos ( numeric_expression ) Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine is "numeric_expression". asin ( numeric_expression ) Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is "numeric_expression". atan ( numeric_expression ) Returns the arctangent of "numeric_expression" in radians. 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 arctangent is the angle whose tangent is "numeric_expression2" / "numeric_expression1". cos ( numeric_expression ) Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in radians. 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. degrees ( numeric_expression ) Returns the degrees where "numeric_expression" is an angle expressed in radians. radians ( numeric_expression ) Returns the radians where "numeric_expression" is an angle expressed in degrees.
Netezza Fuzzy Returns a value indicating how different the two input strings are, calculated according to the Levenshtein edit distance algorithm. le_dst ( string_expression1 , string_expression2 ) Returns a value indicating how different the two input strings are, calculated according to the Damerau-Levenshtein distance algorithm dle_dst ( string_expression1 , string_expression2 )
Netezza Phonetic Returns a Soundex representation of "string_expression" using the New York State Identification and Intelligence System (NYSIIS) variation of Soundex. nysiis ( string_expression ) Returns a composite 32-bit value of "string_expression". dbl_mp ( string_expression ) Returns the 4 character primary metaphone string from "numeric_expression" returned by dbl_mp. pri_mp ( numeric_expression ) Returns the 4 character secondary metaphone string from "numeric_expression" returned by dbl_mp. sec_mp ( numeric_expression ) Returns a score for how closely "numeric_expression" and "numeric_expression2" match. score_mp ( numeric_expression , numeric_expression2 , numeric_expression3 , numeric_expression4 , numeric_expression5 , numeric_expression6 )