Greenplum
Greenplum Common Greenplum Returns the name of the current schema. current_schema () Returns the name of the current database. current_database () {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. chr ( integer_expression ) Returns the character that has the ASCII code value specified by "integer_expression". "Integer_expression" should be between 0 and 255. {user} { user } Returns the username of the current Oracle user. Returns the string value of the database version. version () Returns the timestamp to the specified precision. date_trunc ( string_expression , timestamp_expression) translate ( string_expression1 , string_expression2 , string_expression3 ) Returns "string_expression1" with each occurrence of each character in "string_expression2" replaced by its corresponding character in "string_expression3".
Greenplum String overlay ( string_expression1 , string_expression2 , numeric_expression1 [ , numeric_expression2 ] ) Returns the "string_expression1" replacing "string_expression2" from character position "numeric_expression". btrim ( string_expression1 [ , string_expression2 ] ) Returns "string_expression1" after removing the longest string of characters in "string_expression2". initcap ( string_expression ) Returns "string_expression" 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. 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. md5 ( string_expression1 ) Returns the MD5 hash of "string_expression1". Returns the hexadecimal string representation of "numeric_expression1". to_hex ( numeric_expression1 ) repeat ( string_expression , numeric_expression1 ) Returns the "string_expression" repeated "numeric_expression1" times. replace ( string_expression , string_expression2 , string_expression3) Returns "string_expression" having replaced "string_expression2" with "string_expression3". 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. split_part ( string_expression1 , string_expression2 , numeric_expression ) Returns "numeric_expression" field having split "string_expression1" on "string_expression2".
Greenplum Math log ( numeric_expression1 [ , numeric_expression2 ] ) Returns the base 10 logarithm of "numeric_expression1" or logarithm to the base "numeric_expression2". ln ( numeric_expression ) Returns the natural logarithm of "numeric_expression1". cbrt ( numeric_expression ) Returns the cube root of "numeric_expression1". div ( numeric_expression1 , numeric_expression2 ) Returns the integer quotient of "numeric_expression1" divided by "numeric_expression2". pi () Returns the constant of pi.
Greenplum 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. cot ( numeric_expression ) Returns the cotangent 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.
Greenplum Data type formatting to_char ( expression , string_expression ) Returns the string representation of "expression" with the format of "string_expression". "Expression" can either be a date value or a numeric value. to_date ( string_expression1 , string_expression2 ) Converts "string_expression1" to a date value as specified by the format "string_expression2". 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 )