Oracle SQL Function Cheat Sheet
http://www.databasestar.com/oracle-sql-functions
Aggregate Functions INITCAP ( input_string )
Numeric and Maths Functions INSTR ( string, substring, [start_position],
AVG ( [DISTINCT|ALL] expression ) [OVER ( [occurrence] )
ABS ( number )
analytic_clause )] INSTR2 ( string, substring, [start_position],
ACOS ( number )
COUNT ( [ * | [ DISTINCT | ALL ] expression) [OVER [occurrence] )
ASIN ( number )
(analytic_clause)] INSTR4 ( string, substring, [start_position],
ATAN2 ( number1 [/|,] number2 )
MAX ( [DISTINCT|ALL] expression ) [OVER [occurrence] )
BITAND ( expr1, expr2 )
(analytic_clause)] INSTRB ( string, substring, [start_position],
CEIL ( input_val )
MIN ( [DISTINCT|ALL] expression ) [OVER ( [occurrence] )
CORR ( expression1, expression2 )
analytic_clause )] INSTRC ( string, substring, [start_position],
COS ( number )
SUM ( [DISTINCT|ALL] expression ) [OVER [occurrence] )
COSH (number)
(analytic_clause)] LISTAGG ( measure_expr [, delimiter]) WITHIN
COVAR_POP ( expression1, expression2 ) [OVER
Conversion Functions (analytic_clause)] GROUP (order_by_clause) [OVER
COVAR_SAMP ( expression1, expression2 ) [OVER query_partition_clause]
BIN_TO_NUM ( expression_list ) (analytic_clause)] LENGTH ( string_value )
CAST ( expression AS type_name ) CUME_DIST (expression1, expression_n) WITHIN LENGTH2 ( string_value )
CAST ( MULTISET (subquery) AS type_name ) GROUP (ORDER BY expression_order1, LENGTH4 ( string_value )
COALESCE ( expr1, expr2, [expr] ) expression_order_n) LENGTHB ( string_value )
CHARTOROWID ( input_char ) CUME_DIST() OVER ( [query_partition_clause] LENGTHC ( string_value )
FROM_TZ ( timestamp_value, timezone_value ) ORDER BY order_clause ) LOWER ( input_string )
HEXTORAW ( charvalue ) DENSE_RANK ( expr, [expr(n)] ) WITHIN GROUP ( LPAD( expr, length [, pad_expr] )
NUMTODSINTERVAL ( number, interval_unit ) ORDER BY (order_expr [ASC|DESC] [NULLS LTRIM( input_string, [trim_string] )
NUMTOYMINTERVAL ( number, interval_unit ) FIRST|LAST] ) LNNVL ( condition )
RAWTOHEX ( charvalue ) DENSE_RANK() OVER ( [query_partition_clause] NCHR ( number_code )
RAWTONHEX ( raw ) order_by_clause) NLS_INITCAP ( input_char [, nlsparam ] )
ROWIDTOCHAR ( rowid ) EXP ( number ) NLS_LOWER ( input_char [, nlsparam ] )
ROWIDTONCHAR ( rowid ) EXTRACT ( date_component FROM expression ) NLS_UPPER ( input_char [, nlsparam ] )
SCN_TO_TIMESTAMP ( number ) FLOOR ( input_number ) NLSSORT ( input_char [, nlsparam ] )
TIMESTAMP_TO_SCN ( timestamp ) GREATEST ( expr1, [expr_n] ) NANVL ( check_value, replace_value )
TO_BINARY_DOUBLE ( expression [, format [, LEAST ( expr1, [expr_n] ) NVL ( check_value, replace_value )
nlsparam ] ] ) LN ( number ) NVL2 ( value_to_check, value_if_not_null,
TO_CHAR( input_value, [format_mask], LOG ( [base, ] expression ) value_if_null )
[nls_parameter] ) MEDIAN ( expr ) [OVER (query_partition_clause)] NULLIF ( expr1, expr2 )
TO_CLOB ( input_string ) MOD ( numerator, denominator ) REGEXP_COUNT ( source_char, pattern [, position [,
TO_DATE( charvalue, [format_mask], ORA_HASH ( expression [, max_bucket [, match_pattern [, subexpression ] ] ] )
[nls_date_language] ) seed_value ] ] ) REGEXP_INSTR ( source_char, pattern [, position [,
TO_DSINTERVAL ( input_string [, nlsparam] ) PERCENT_RANK ( expression ) WITHIN GROUP ( occurrence [, return_option [, match_pattern [,
TO_LOB ( long_value ) ORDER BY (expression_n [. DESC | ASC ] [NULLS subexpression ] ] ] ] ] )
TO_MULTI_BYTE ( string ) FIRST|LAST] ) REGEXP_REPLACE ( source_char, pattern [,
TO_NCHAR ( input_string ) PERCENT_RANK () OVER ( [query_partition_clause] replace_string [, position [, occurrence [,
TO_NCHAR ( input_datetime [, format [,nlsparam ] ] ) order_by_clause ) match_parameter ] ] ] ] )
TO_NCHAR ( number [, format [, nlsparam ] ] ) PERCENTILE_CONT ( expression) WITHIN GROUP REGEXP_SUBSTR ( source_char, pattern [, position
TO_NCLOB ( lob_value ) ( ORDER BY expression [ ASC | DESC ] [OVER ( [, occurrence [, match_parameter ] ] ] ] )
TO_NUMBER ( input_value, [format_mask], query_partition_clause ) REPLACE ( whole_string, string_to_replace,
[nls_parameter] ) PERCENTILE_DISC ( expression) WITHIN GROUP ( [replacement_string])
TO_SINGLE_BYTE ( input_string ) ORDER BY expression [ ASC | DESC ] [OVER ( RPAD ( expr, length [, pad_expr] )
TO_TIMESTAMP ( input_string, [format_mask], query_partition_clause ) RTRIM ( input_string, [trim_character])
[nlsparam] ) POWER ( n2, n1 ) SOUNDEX ( string )
TO_TIMESTAMP_TZ ( input_string [, format_mask] [, RANK ( expr ) WITHIN GROUP ( ORDER BY ( SUBSTR ( string, start_position, [length] )
nls_param] ) order_expr [NULLS FIRST/LAST] ) ) TRANSLATE ( source, from_string, to_string )
TO_YMINTERVAL ( input_string ) RANK () OVER ( [query_partition_clause] TRANSLATE ( charvalue USING
UNISTR ( string ) order_by_clause ) {CHAR_CS|NCHAR_CS} )
REMAINDER ( n2, n1 ) TREAT ( expression AS [ REF ] [ schema. ] type )
Date and Time Functions ROUND ( input, roundto ) TRIM ( [ [ LEADING | TRAILING | BOTH ]
ROWNUM trim_character FROM ] trim_source )
ADD_MONTHS ( input_date, number_months ) UPPER ( input_string )
ROW_NUMBER () OVER ( [ query_partition_clause]
CURRENT_DATE VSIZE ( expression )
order_by_clause )
CURRENT_TIMESTAMP ( [precision] )
SIGN ( number )
DBTIMEZONE Analytic Functions
SIN ( number )
LAST_DAY ( input_date )
SINH ( number ) FIRST_VALUE ( expression [ IGNORE NULLS ] )
LOCALTIMESTAMP ( timestamp_precision )
SQRT ( number ) OVER ( analytic_clause )
MONTHS_BETWEEN ( date1, date2 )
STANDARD_HASH ( expression [, method ] ) LAST_VALUE ( expression [ IGNORE NULLS ] )
NEW_TIME ( input_date, timezone1, timezone2 )
STDDEV ( [DISTINCT | ALL] expression ) [OVER OVER ( analytic_clause )
NEXT_DAY ( input_date, weekday )
(analytical_clause) ] LAG ( expression [, offset [, default] ] ) OVER ( [
SESSIONTIMEZONE
STDDEV_POP ( expression) [ OVER ( query_partition_clause ] order_by_clause )
SYS_EXTRACT_UTC (
analytic_clause ) ] LEAD ( expression [, offset [, default] ] ) OVER ( [
datetime_with_timezone_value )
STDDEV_SAMP ( expression) [ OVER ( query_partition_clause ] order_by_clause )
SYSDATE
analytic_clause ) ] NTILE ( expression ) OVER (
SYSTIMESTAMP
TAN ( number ) [query_partition_clause] order_by_clause )
TZ_OFFSET ( timezone_name | time_value |
TANH ( number ) RATIO_TO_REPORT( expression ) OVER (
SESSIONTIMEZONE | DBTIMEZONE )
TRUNC ( date, fmt ) [query_partition_clause] )
Environment Functions TRUNC ( number, decimals )
VAR_POP ( expression) [OVER ( analytic_clause )] Other Functions
CON_DBID_TO_ID ( container_dbid ) VAR_SAMP ( expression) [OVER ( analytic_clause )] CASE [expression]
CON_GUID_TO_ID ( container_guid ) VARIANCE ( [ DISTINCT | ALL ] expression) [ OVER WHEN condition_1 THEN result_1
CON_NAME_TO_ID ( container_name ) ( analytic_clause ) ] WHEN condition_n THEN result_n
CON_UID_TO_ID ( container_uid ) WIDTH_BUCKET ( expression, min_value, ELSE result
ORA_INVOKING_USER max_value, num_buckets ) END case_name
ORA_INVOKING_USERID ( )
SYS_CONTEXT (namespace, parameter [, length] ) String and Character Functions
SYS_CONNECT_BY_PATH ( column,
SYS_GUID()
ASCII ( charvalue ) character_separator )
SYS_TYPEID ( object_type_value )
ASCIISTR ( charvalue )
UID
CHR ( number_code [USING NCHAR_CS] )
USER Grouping Functions
COMPOSE ( input_value )
USERENV ( parameter )
CONCAT( string1, string2 ) GROUP_ID ( )
SQLCODE
CONVERT ( input_char, dest_char_set, GROUPING ( expression )
SQLERRM ( error_number )
[source_char_set] ) GROUPING_ID ( expression1 [, expression_n ] )
NLS Functions DECODE ( expression, search, result [, search,
result] [,default] ) Large Object Functions
NLS_CHARSET_DECL_LEN ( byte_count, DECOMPOSE ( input_string
char_set_id ) BFILENAME ( directory, filename )
[CANONICAL|COMPATIBILITY] )
NLS_CHARSET_ID ( string_value ) EMPTY_BLOB ()
DUMP ( expression [, return_format] [, start_position]
NLS_CHARSET_NAME ( number ) EMPTY_CLOB ()
[, length] )