PK
<–Aoa«, mimetypeapplication/epub+zipPK <–A iTunesMetadata.plistRû
A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE
, FALSE
, or unknown.
Conditions have several forms. The sections that follow show the syntax for each form of condition. Refer to Chapter 5, "Subclauses" for the syntax of the subclauses.
See Also: Conditions in Oracle Database SQL Language Reference for detailed information about SQL conditions |
expr1 [ NOT ] BETWEEN expr2 AND expr3
{ (condition) | NOT condition | condition { AND | OR } condition }
EQUALS_PATH (column, path_string [, correlation_integer ])
EXISTS (subquery)
expr IS [ NOT ] { NAN | INFINITE }
{ expr { = | != | ^= | <> | > | < | >= | <= } { ANY | SOME | ALL } ({ expression_list | subquery }) | ( expr [, expr ]... ) { = | != | ^= | <> } { ANY | SOME | ALL } ({ expression_list [, expression_list ]... | subquery } ) }
where !=
, ^=
, and <>
test for inequality
{ expr [ NOT ] IN ({ expression_list | subquery }) | ( expr [, expr ]... ) [ NOT ] IN ({ expression_list [, expression_list ]... | subquery } ) }
nested_table IS [ NOT ] A SET
[ dimension_column IS ] ANY
nested_table IS [ NOT ] EMPTY
expr IS [ NOT ] OF [ TYPE ] ([ ONLY ] [ schema. ] type [, [ ONLY ] [ schema. ] type ]... )
cell_reference IS PRESENT
char1 [ NOT ] { LIKE | LIKEC | LIKE2 | LIKE4 } char2 [ ESCAPE esc_char ]
{ NOT | AND | OR }
expr [ NOT ] MEMBER [ OF ] nested_table
expr IS [ NOT ] NULL
REGEXP_LIKE(source_char, pattern [, match_param ] )
{ expr { = | != | ^= | <> | > | < | >= | <= } expr | (expr [, expr ]...) { = | != | ^= | <> } (subquery) }
where !=
, ^=
, and <>
test for inequality
nested_table1 [ NOT ] SUBMULTISET [ OF ] nested_table2
UNDER_PATH (column [, levels ], path_string [, correlation_integer ] )
This chapter presents the syntax for SQL functions.
This chapter includes the following section:
SQL Language Quick Reference
11g Release 2 (11.2)
E17119-06
July 2012
Oracle Database SQL Language Quick Reference, 11g Release 2 (11.2)
E17119-06
Copyright © 2003, 2012, Oracle and/or its affiliates. All rights reserved.
Primary Authors: Diana Lorentz, Mary Beth Roeser, Simon Watt
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
This section describes the kinds of Oracle built-in data types.
{ CHAR [ (size [ BYTE | CHAR ]) ] | VARCHAR2 (size [ BYTE | CHAR ]) | NCHAR [ (size) ] | NVARCHAR2 (size) }
{ DATE | TIMESTAMP [ (fractional_seconds_precision) ] [ WITH [ LOCAL ] TIME ZONE ]) | INTERVAL YEAR [ (year_precision) ] TO MONTH | INTERVAL DAY [ (day_precision) ] TO SECOND [ (fractional_seconds_precision) ] }
{ BLOB | CLOB | NCLOB | BFILE }
{ LONG | LONG RAW | RAW (size) }
{ NUMBER [ (precision [, scale ]) ] | FLOAT [ (precision) ] | BINARY_FLOAT | BINARY_DOUBLE }
{ ROWID | UROWID [ (size) ] }
The codes listed for the data types are used internally by Oracle Database. The data type code of a column or object attribute is returned by the DUMP
function.
Table 6-1 Built-in Data Type Summary
Code | Data Type | Description |
---|---|---|
1 |
|
Variable-length character string having maximum length
|
1 |
|
Variable-length Unicode character string having maximum length |
2 |
|
Number having precision |
2 |
|
A subtype of the |
8 |
|
Character data of variable length up to 2 gigabytes, or 231 -1 bytes. Provided for backward compatibility. |
12 |
|
Valid date range from January 1, 4712 BC, to December 31, 9999 AD. The default format is determined explicitly by the |
21 |
|
32-bit floating point number. This data type requires 4 bytes. |
22 |
|
64-bit floating point number. This data type requires 8 bytes. |
180 |
|
Year, month, and day values of date, as well as hour, minute, and second values of time, where |
181 |
|
All values of |
231 |
|
All values of
The default format is determined explicitly by the |
182 |
|
Stores a period of time in years and months, where |
183 |
|
Stores a period of time in days, hours, minutes, and seconds, where
The size is fixed at 11 bytes. |
23 |
|
Raw binary data of length |
24 |
|
Raw binary data of variable length up to 2 gigabytes. |
69 |
|
Base 64 string representing the unique address of a row in its table. This data type is primarily for values returned by the |
208 |
|
Base 64 string representing the logical address of a row of an index-organized table. The optional |
96 |
|
Fixed-length character data of length
|
96 |
|
Fixed-length character data of length |
112 |
|
A character large object containing single-byte or multibyte characters. Both fixed-width and variable-width character sets are supported, both using the database character set. Maximum size is (4 gigabytes - 1) * (database block size). |
112 |
|
A character large object containing Unicode characters. Both fixed-width and variable-width character sets are supported, both using the database national character set. Maximum size is (4 gigabytes - 1) * (database block size). Stores national character set data. |
113 |
|
A binary large object. Maximum size is (4 gigabytes - 1) * (database block size). |
114 |
|
Contains a locator to a large binary file stored outside the database. Enables byte stream I/O access to external LOBs residing on the database server. Maximum size is 4 gigabytes. |
A format model is a character literal that describes the format of DATETIME
or NUMBER
data stored in a character string. When you convert a character string into a datetime or number, a format model tells Oracle how to interpret the string.
You can use number format models:
In the TO_CHAR
function to translate a value of NUMBER
data type to VARCHAR2
data type
In the TO_NUMBER
function to translate a value of CHAR
or VARCHAR2
data type to NUMBER
data type
A number format model is composed of one or more number format elements. The following table lists the elements of a number format model.
Table 7-1 Number Format Elements
Element | Example | Description |
---|---|---|
, (comma) |
|
Returns a comma in the specified position. You can specify multiple commas in a number format model. Restrictions:
|
. (period) |
|
Returns a decimal point, which is a period (.) in the specified position. Restriction: You can specify only one period in a number format model. |
$ |
|
Returns value with a leading dollar sign. |
0 |
|
Returns leading zeros. Returns trailing zeros. |
9 |
|
Returns value with the specified number of digits with a leading space if positive or with a leading minus if negative. Leading zeros are blank, except for a zero value, which returns a zero for the integer part of the fixed-point number. |
B |
|
Returns blanks for the integer part of a fixed-point number when the integer part is zero (regardless of zeros in the format model). |
|
Returns in the specified position the ISO currency symbol (the current value of the | |
|
Returns in the specified position the decimal character, which is the current value of the Restriction: You can specify only one decimal character in a number format model. | |
|
Returns a value using in scientific notation. | |
|
Returns in the specified position the group separator (the current value of the Restriction: A group separator cannot appear to the right of a decimal character or period in a number format model. | |
|
Returns in the specified position the local currency symbol (the current value of the | |
MI |
|
Returns negative value with a trailing minus sign (-). Returns positive value with a trailing blank. Restriction: The MI format element can appear only in the last position of a number format model. |
PR |
|
Returns negative value in <angle brackets>. Returns positive value with a leading and trailing blank. Restriction: The PR format element can appear only in the last position of a number format model. |
RN rn |
|
Returns a value as Roman numerals in uppercase. Returns a value as Roman numerals in lowercase. Value can be an integer between 1 and 3999. |
S |
|
Returns negative value with a leading minus sign (-). Returns positive value with a leading plus sign (+). Returns negative value with a trailing minus sign (-). Returns positive value with a trailing plus sign (+). Restriction: The S format element can appear only in the first or last position of a number format model. |
TM |
|
The text minimum number format model returns (in decimal output) the smallest number of characters possible. This element is case insensitive. The default is TM9, which returns the number in fixed notation unless the output exceeds 64 characters. If the output exceeds 64 characters, then Oracle Database automatically returns the number in scientific notation. Restrictions:
|
|
Returns in the specified position the Euro (or other) dual currency symbol, determined by the current value of the | |
V |
|
Returns a value multiplied by 10n (and if necessary, round it up), where |
|
Returns the hexadecimal value of the specified number of digits. If the specified number is not an integer, then Oracle Database rounds it to an integer. Restrictions:
|
You can use datetime format models:
In the TO_CHAR
, TO_DATE
, TO_TIMESTAMP
, TO_TIMESTAMP_TZ
, TO_YMINTERVAL
, and TO_DSINTERVAL
datetime functions to translate a character string that is in a format other than the default datetime format into a DATETIME
value
In the TO_CHAR
function to translate a DATETIME
value that is in a format other than the default datetime format into a character string
A datetime format model is composed of one or more datetime format elements. The following table lists the elements of a date format model.
Table 7-2 Datetime Format Elements
Element | TO_* datetime functions? | Description |
---|---|---|
- / , . ; : "text" |
Yes |
Punctuation and quoted text is reproduced in the result. |
AD A.D. |
Yes |
AD indicator with or without periods. |
AM A.M. |
Yes |
Meridian indicator with or without periods. |
BC B.C. |
Yes |
BC indicator with or without periods. |
CC SCC |
Century.
For example, 2002 returns 21; 2000 returns 20. | |
D |
Yes |
Day of week (1-7). This element depends on the NLS territory of the session. |
DAY |
Yes |
Name of day. |
DD |
Yes |
Day of month (1-31). |
DDD |
Yes |
Day of year (1-366). |
DL |
Yes |
Returns a value in the long date format, which is an extension of Oracle Database's Restriction: You can specify this format only with the |
DS |
Yes |
Returns a value in the short date format. Makes the appearance of the date components (day name, month number, and so forth) depend on the Restriction: You can specify this format only with the |
DY |
Yes |
Abbreviated name of day. |
E |
Yes |
Abbreviated era name (Japanese Imperial, ROC Official, and Thai Buddha calendars). |
EE |
Yes |
Full era name (Japanese Imperial, ROC Official, and Thai Buddha calendars). |
|
Yes |
Fractional seconds; no radix character is printed. Use the X format element to add the radix character. Use the numbers 1 to 9 after FF to specify the number of digits in the fractional second portion of the datetime value returned. If you do not specify a digit, then Oracle Database uses the precision specified for the datetime data type or the data type's default precision. Valid in timestamp and interval formats, but not in Examples:
|
|
Yes |
Returns a value with no leading or trailing blanks. See Also: Additional discussion on this format model modifier in the Oracle Database SQL Language Reference |
|
Yes |
Requires exact matching between the character data and the format model. See Also: Additional discussion on this format model modifier in the Oracle Database SQL Language Reference |
HH HH12 |
Yes |
Hour of day (1-12). |
HH24 |
Yes |
Hour of day (0-23). |
IW |
Week of year (1-52 or 1-53) based on the ISO standard. | |
IYY IY I |
Last 3, 2, or 1 digit(s) of ISO year. | |
IYYY |
4-digit year based on the ISO standard. | |
J |
Yes |
Julian day; the number of days since January 1, 4712 BC. Number specified with J must be integers. |
MI |
Yes |
Minute (0-59). |
MM |
Yes |
Month (01-12; January = 01). |
MON |
Yes |
Abbreviated name of month. |
MONTH |
Yes |
Name of month. |
PM P.M. |
Yes |
Meridian indicator with or without periods. |
Q |
Quarter of year (1, 2, 3, 4; January - March = 1). | |
RM |
Yes |
Roman numeral month (I-XII; January = I). |
RR |
Yes |
Lets you store 20th century dates in the 21st century using only two digits. See Also: Additional discussion on |
RRRR |
Yes |
Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as RR. If you do not want this functionality, then enter the 4-digit year. |
SS |
Yes |
Second (0-59). |
SSSSS |
Yes |
Seconds past midnight (0-86399). |
TS |
Yes |
Returns a value in the short time format. Makes the appearance of the time components (hour, minutes, and so forth) depend on the Restriction: You can specify this format only with the |
TZD |
Yes |
Daylight saving information. The TZD value is an abbreviated time zone string with daylight saving information. It must correspond with the region specified in TZR. Valid in timestamp and interval formats, but not in Example: |
TZH |
Yes |
Time zone hour. (See Example: |
TZM |
Yes |
Time zone minute. (See Example: |
TZR |
Yes |
Time zone region information. The value must be one of the time zone regions supported in the database. Valid in timestamp and interval formats, but not in Example: US/Pacific |
WW |
Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year. | |
W |
Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. | |
X |
Yes |
Local radix character. Example: |
Y,YYY |
Yes |
Year with comma in this position. |
YEAR SYEAR |
Year, spelled out; | |
YYYY SYYYY |
Yes |
4-digit year; |
YYY YY Y |
Yes |
Last 3, 2, or 1 digit(s) of year. |
SQL statements that create tables and clusters can also use ANSI data types and data types from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM data type name that differs from the Oracle data type name, records it as the name of the data type of the column, and then stores the column data in an Oracle data type based on the conversions shown in the following table.
Table 6-2 ANSI Data Types Converted to Oracle Data Types
ANSI SQL Data Type | Oracle Data Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notes:
The NUMERIC
and DECIMAL
data types can specify only fixed-point numbers. For those data types, the scale (s
) defaults to 0.
The FLOAT
data type is a floating-point number with a binary precision b. The default precision for this data type is 126 binary, or 38 decimal.
The DOUBLE PRECISION
data type is a floating-point number with binary precision 126.
The REAL
data type is a floating-point number with a binary precision of 63, or 18 decimal.
Do not define columns with the following SQL/DS and DB2 data types, because they have no corresponding Oracle data type:
GRAPHIC
LONG
VARGRAPHIC
VARGRAPHIC
TIME
Note that data of type TIME
can also be expressed as Oracle datetime data.
A function is a command that manipulates data items and returns a single value.
The sections that follow show each SQL function and its related syntax. Refer to Chapter 5, "Subclauses" for the syntax of the subclauses.
See Also: Functions in Oracle Database SQL Language Reference for detailed information about SQL functions |
ABS(n)
ACOS(n)
ADD_MONTHS(date, integer)
Aggregate functions return a single result row based on groups of rows, rather than on single rows.
analytic_function([ arguments ]) OVER (analytic_clause)
APPENDCHILDXML ( XMLType_instance, XPath_string, value_expr [, namespace_string ])
ASCII(char)
ASCIISTR(char)
ASIN(n)
ATAN(n)
ATAN2(n1 , n2)
AVG([ DISTINCT | ALL ] expr) [ OVER(analytic_clause) ]
BFILENAME('directory', 'filename')
BIN_TO_NUM(expr [, expr ]... )
BITAND(expr1, expr2)
CARDINALITY(nested_table)
CAST({ expr | MULTISET (subquery) } AS type_name)
CEIL(n)
CHARTOROWID(char)
CHR(n [ USING NCHAR_CS ])
CLUSTER_ID ( [ schema . ] model mining_attribute_clause )
CLUSTER_PROBABILITY ( [ schema . ] model [ , cluster_id ] mining_attribute_clause )
CLUSTER_SET ( [ schema . ] model [ , topN [ , cutoff ] ] mining_attribute_clause )
COALESCE(expr [, expr ]...)
COLLECT( [ DISTINCT | UNIQUE ] column [ ORDER BY expr ] )
COMPOSE(char)
CONCAT(char1, char2)
CONVERT(char, dest_char_set[, source_char_set ])
CORR(expr1, expr2) [ OVER (analytic_clause) ]
{ CORR_K | CORR_S } (expr1, expr2 [, { COEFFICIENT | ONE_SIDED_SIG | ONE_SIDED_SIG_POS | ONE_SIDED_SIG_NEG | TWO_SIDED_SIG } ] )
COS(n)
COSH(n)
COUNT({ * | [ DISTINCT | ALL ] expr }) [ OVER (analytic_clause) ]
COVAR_POP(expr1, expr2) [ OVER (analytic_clause) ]
COVAR_SAMP(expr1, expr2) [ OVER (analytic_clause) ]
CUBE_TABLE ( ' { schema.cube [ {HIERARCHY | HRR} dimension hierarchy ]... | schema.dimension [ {HIERARCHY | HRR} [dimension] hierarchy ] } ' )
CUME_DIST(expr[,expr ]...) WITHIN GROUP (ORDER BY expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] [, expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] ]... )
CUME_DIST() OVER ([ query_partition_clause ] order_by_clause)
CURRENT_DATE
CURRENT_TIMESTAMP [ (precision) ]
CV([ dimension_column ])
DATAOBJ_TO_PARTITION( table, partition_id )
DBTIMEZONE
DECODE(expr, search, result [, search, result ]... [, default ])
DECOMPOSE( string [ CANONICAL | COMPATIBILITY ] )
DELETEXML( XMLType_instance, XPath_string [, namespace_string ])
DENSE_RANK(expr [, expr ]...) WITHIN GROUP (ORDER BY expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] [,expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] ]... )
DENSE_RANK( ) OVER([ query_partition_clause ] order_by_clause)
DEPTH(correlation_integer)
DEREF(expr)
DUMP(expr[, return_fmt [, start_position [, length ] ]])
{ EMPTY_BLOB | EMPTY_CLOB }( )
EXISTSNODE (XMLType_instance, XPath_string [, namespace_string ] )
EXP(n)
EXTRACT( { YEAR | MONTH | DAY | HOUR | MINUTE | SECOND | TIMEZONE_HOUR | TIMEZONE_MINUTE | TIMEZONE_REGION | TIMEZONE_ABBR } FROM { expr } )
EXTRACT(XMLType_instance, XPath_string [, namespace_string ])
EXTRACTVALUE(XMLType_instance, XPath_string [, namespace_string ])
FEATURE_ID( [ schema . ] model mining_attribute_clause )
FEATURE_SET( [ schema . ] model [, topN [, cutoff ]] mining_attribute_clause )
FEATURE_VALUE( [ schema . ] model [, feature_id ] mining_attribute_clause )
aggregate_function KEEP (DENSE_RANK FIRST ORDER BY expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] [, expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] ]... ) [ OVER ( [query_partition_clause] ) ]
FIRST_VALUE { (expr) [ {RESPECT | IGNORE} NULLS ] | (expr [ {RESPECT | IGNORE} NULLS ]) } OVER (analytic_clause)
FLOOR(n)
FROM_TZ (timestamp_value, time_zone_value)
GREATEST(expr [, expr ]...)
GROUP_ID( )
GROUPING(expr)
GROUPING_ID(expr [, expr ]...)
HEXTORAW(char)
INITCAP(char)
INSERTCHILDXML ( XMLType_instance, XPath_string, child_expr, value_expr [, namespace_string ] )
INSERTCHILDXMLAFTER ( XMLType_instance, XPath_string, child_expr, value_expr [, namespace_string ] )
INSERTCHILDXMLBEFORE ( XMLType_instance, XPath_string, child_expr, value_expr [, namespace_string ] )
INSERTXMLAFTER ( XMLType_instance, XPath_string, value_expr [, namespace_string ] )
INSERTXMLBEFORE ( XMLType_instance, XPath_string, value_expr [, namespace_string ] )
{ INSTR | INSTRB | INSTRC | INSTR2 | INSTR4 } (string , substring [, position [, occurrence ] ])
ITERATION_NUMBER
LAG { ( value_expr [, offset [, default]]) [ { RESPECT | IGNORE } NULLS ] | ( value_expr [ { RESPECT | IGNORE } NULLS ] [, offset [, default]] ) } OVER ([ query_partition_clause ] order_by_clause)
aggregate_function KEEP (DENSE_RANK LAST ORDER BY expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] [, expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] ]... ) [ OVER ( [query_partition_clause] ) ]
LAST_DAY(date)
LAST_VALUE { (expr) [ { RESPECT | IGNORE } NULLS ] | (expr [ { RESPECT | IGNORE } NULLS ]) OVER (analytic_clause)
LEAD { ( value_expr [, offset [, default]] ) [ { RESPECT | IGNORE } NULLS ] | ( value_expr [ { RESPECT | IGNORE } NULLS ] [, offset [, default]] ) } OVER ([ query_partition_clause ] order_by_clause)
LEAST(expr [, expr ]...)
{ LENGTH | LENGTHB | LENGTHC | LENGTH2 | LENGTH4 } (char)
LISTAGG(measure_expr [, 'delimiter']) WITHIN GROUP (order_by_clause) [OVER query_partition_clause]
LN(n)
LNNVL(condition)
LOCALTIMESTAMP [ (timestamp_precision) ]
LOG(n2, n1)
LOWER(char)
LPAD(expr1, n [, expr2 ])
LTRIM(char [, set ])
MAKE_REF({ table | view } , key [, key ]...)
MAX([ DISTINCT | ALL ] expr) [ OVER (analytic_clause) ]
MEDIAN(expr) [ OVER (query_partition_clause) ]
MIN([ DISTINCT | ALL ] expr) [ OVER (analytic_clause) ]
MOD(n2, n1)
MONTHS_BETWEEN(date1, date2)
NANVL(n2, n1)
NCHR(number)
NEW_TIME(date, timezone1, timezone2)
NEXT_DAY(date, char)
NLS_CHARSET_DECL_LEN(byte_count, 'char_set_id')
NLS_CHARSET_ID(string)
NLS_CHARSET_NAME(number)
NLS_INITCAP(char [, 'nlsparam' ])
NLS_LOWER(char [, 'nlsparam' ])
NLS_UPPER(char [, 'nlsparam' ])
NLSSORT(char [, 'nlsparam' ])
NTH_VALUE(measure_expr, n) [ FROM { FIRST | LAST } ][ { RESPECT | IGNORE } NULLS ] OVER (analytic_clause)
NTILE(expr) OVER ([ query_partition_clause ] order_by_clau €ÿse)
NULLIF(expr1, expr2)
NUMTODSINTERVAL(n, 'interval_unit')
NUMTOYMINTERVAL(n, 'interval_unit')
NVL(expr1, expr2)
NVL2(expr1, expr2, expr3)
ORA_DST_AFFECTED(datetime_expr)
ORA_DST_CONVERT(datetime_expr [, integer [, integer ]])
ORA_DST_ERROR(datetime_expr)
ORA_HASH(expr [, max_bucket [, seed_value ] ])
PATH(correlation_integer)
PERCENT_RANK(expr [, expr ]...) WITHIN GROUP (ORDER BY expr [ DESC | ASC ] [NULLS { FIRST | LAST } ] [, expr [ DESC | ASC ] [NULLS { FIRST | LAST } ] ]... )
PERCENT_RANK( ) OVER ([ query_partition_clause ] order_by_clause)
PERCENTILE_CONT(expr) WITHIN GROUP (ORDER BY expr [ DESC | ASC ]) [ OVER (query_partition_clause) ]
PERCENTILE_DISC(expr) WITHIN GROUP (ORDER BY expr [ DESC | ASC ]) [ OVER (query_partition_clause) ]
POWER(n2, n1)
POWERMULTISET(expr)
POWERMULTISET_BY_CARDINALITY(expr, cardinality)
PREDICTION ( [ schema . ] model [ cost_matrix_clause ] mining_attribute_clause )
PREDICTION_BOUNDS ( [schema.] model [, confidence_level [, class_value]] mining_attribute_clause )
PREDICTION_COST ( [ schema . ] model [ , class ] cost_matrix_clause mining_attribute_clause )
PREDICTION_DETAILS ( [ schema . ] model mining_attribute_clause )
PREDICTION_PROBABILITY ( [ schema . ] model [ , class ] mining_attribute_clause )
PREDICTION_SET ( [ schema . ] model [ , bestN [ , cutoff ] ] [ cost_matrix_clause ] mining_attribute_clause )
PRESENTNNV(cell_reference, expr1, expr2)
PRESENTV(cell_reference, expr1, expr2)
PREVIOUS(cell_reference)
RANK(expr [, expr ]...) WITHIN GROUP (ORDER BY expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] [, expr [ DESC | ASC ] [ NULLS { FIRST | LAST } ] ]... )
RANK( ) OVER ([ query_partition_clause ] order_by_clause)
RATIO_TO_REPORT(expr) OVER ([ query_partition_clause ])
RAWTOHEX(raw)
RAWTONHEX(raw)
REF (correlation_variable)
REFTOHEX (expr)
REGEXP_COUNT (source_char, pattern [, position [, match_param]])
REGEXP_INSTR (source_char, pattern [, position [, occurrence [, return_opt [, match_param [, subexpr] ] ] ] ]
REGEXP_REPLACE(source_char, pattern [, replace_string [, position [, occurrence [, match_param ] ] ] ] )
REGEXP_SUBSTR(source_char, pattern [, position [, occurrence [, match_param [, subexpr ] ] ] ] )
REGR_AVGX, REGR_AVGY, REGR_COUNT, REGR_INTERCEPT, REGR_R2, REGR_SLOPE, REGR_SXX, REGR_SXY, REGR_SYY
{ REGR_SLOPE | REGR_INTERCEPT | REGR_COUNT | REGR_R2 | REGR_AVGX | REGR_AVGY | REGR_SXX | REGR_SYY | REGR_SXY } (expr1 , expr2) [ OVER (analytic_clause) ]
REMAINDER(n2, n1)
REPLACE(char, search_string [, replacement_string ] )
ROUND(date [, fmt ])
ROUND(n [, integer ])
ROW_NUMBER( ) OVER ([ query_partition_clause ] order_by_clause)
ROWIDTOCHAR(rowid)
ROWIDTONCHAR(rowid)
RPAD(expr1 , n [, expr2 ])
RTRIM(char [, set ])
SCN_TO_TIMESTAMP(number)
SESSIONTIMEZONE
SET (nested_table)
SIGN(n)
SIN(n)
SINH(n)
SOUNDEX(char)
SQRT(n)
STATS_BINOMIAL_TEST(expr1, expr2, p [, { TWO_SIDED_PROB | EXACT_PROB | ONE_SIDED_PROB_OR_MORE | ONE_SIDED_PROB_OR_LESS } ] )
STATS_CROSSTAB(expr1, expr2 [, { CHISQ_OBS | CHISQ_SIG | CHISQ_DF | PHI_COEFFICIENT | CRAMERS_V | CONT_COEFFICIENT | COHENS_K } ] )
STATS_F_TEST(expr1, expr2 [, { { STATISTIC | DF_NUM | DF_DEN | ONE_SIDED_SIG } , expr3 | TWO_SIDED_SIG } ] )
STATS_KS_TEST(expr1, expr2 [, { STATISTIC | SIG } ] )
STATS_MODE(expr)
STATS_MW_TEST(expr1, expr2 [, { STATISTIC | U_STATISTIC | ONE_SIDED_SIG , expr3 | TWO_SIDED_SIG } ] )
STATS_ONE_WAY_ANOVA(expr1, expr2 [, { SUM_SQUARES_BETWEEN | SUM_SQUARES_WITHIN | DF_BETWEEN | DF_WITHIN | MEAN_SQUARES_BETWEEN | MEAN_SQUARES_WITHIN | F_RATIO | SIG } ] )
STATS_T_TEST_INDEP, STATS_T_TEST_INDEPU, STATS_T_TEST_ONE, STATS_T_TEST_PAIRED
{ STATS_T_TEST_ONE ( expr1 [, expr2 ] | { { STATS_T_TEST_PAIRED | STATS_T_TEST_INDEP | STATS_T_TEST_INDEPU } ( expr1, expr2 } } [, { { STATISTIC | ONE_SIDED_SIG } , expr3 | TWO_SIDED_SIG | DF } ] )
STATS_WSR_TEST(expr1, expr2 [, { STATISTIC | ONE_SIDED_SIG | TWO_SIDED_SIG } ] )
STDDEV([ DISTINCT | ALL ] expr) [ OVER (analytic_clause) ]
STDDEV_POP(expr) [ OVER (analytic_clause) ]
STDDEV_SAMP(expr) [ OVER (analytic_clause) ]
{ SUBSTR | SUBSTRB | SUBSTRC | SUBSTR2 | SUBSTR4 } (char, position [, substring_length ])
SUM([ DISTINCT | ALL ] expr) [ OVER (analytic_clause) ]
SYS_CONNECT_BY_PATH(column, char)
SYS_CONTEXT('namespace', 'parameter' [, length ])
SYS_DBURIGEN({ column | attribute } [ rowid ] [, { column | attribute } [ rowid ] ]... [, 'text ( )' ] )
SYS_EXTRACT_UTC(datetime_with_timezone)
SYS_GUID( )
SYS_TYPEID(object_type_value)
SYS_XMLAGG(expr [, fmt ])
SYS_XMLGEN(expr [, fmt ])
SYSDATE
SYSTIMESTAMP
TAN(n)
TANH(n)
TIMESTAMP_TO_SCN(timestamp)
TO_BINARY_DOUBLE(expr [, fmt [, 'nlsparam' ] ])
TO_BINARY_FLOAT(expr [, fmt [, 'nlsparam' ] ])
TO_BLOB ( raw_value )
TO_CHAR(nchar | clob | nclob)
TO_CHAR({ datetime | interval } [, fmt [, 'nlsparam' ] ])
TO_CHAR(n [, fmt [, 'nlsparam' ] ])
TO_CLOB(lob_column | char)
TO_DATE(char [, fmt [, 'nlsparam' ] ])
TO_DSINTERVAL ( ' { sql_format | ds_iso_format } ' )
TO_LOB(long_column)
TO_MULTI_BYTE(char)
TO_NCHAR({char | clob | nclob})
TO_NCHAR({ datetime | interval } [, fmt [, 'nlsparam' ] ] )
TO_NCHAR(n [, fmt [, 'nlsparam' ] ])
TO_NCLOB(lob_column | char)
TO_NUMBER(expr [, fmt [, 'nlsparam' ] ])
TO_SINGLE_BYTE(char)
TO_TIMESTAMP(char [, fmt [, 'nlsparam' ] ])
TO_TIMESTAMP_TZ(char [, fmt [, 'nlsparam' ] ])
TO_YMINTERVAL ( ' { [+|-] years - months | ym_iso_format } ' )
TRANSLATE(expr, from_string, to_string)
TRANSLATE ( char USING { CHAR_CS | NCHAR_CS } )
TREAT(expr AS [ REF ] [ schema. ]type)
TRIM([ { { LEADING | TRAILING | BOTH } [ trim_character ] | trim_character } FROM ] trim_source )
TRUNC(date [, fmt ])
TRUNC(n1 [, n2 ])
TZ_OFFSET({ 'time_zone_name' | '{ + | - } hh : mi' | SESSIONTIMEZONE | DBTMEZONE } )
UID
UNISTR( string )
UPDATEXML (XMLType_instance, XPath_string, value_expr [, XPath_string, value_expr ]... [, namespace_string ] )
UPPER(char)
USER
[ schema. ] { [ package. ]function | user_defined_operator } [ @ dblink. ] [ ( [ [ DISTINCT | ALL ] expr [, expr ]... ] ) ]
USERENV('parameter')
VALUE(correlation_variable)
VAR_POP(expr) [ OVER (analytic_clause) ]
VAR_SAMP(expr) [ OVER (analytic_clause) ]
VARIANCE([ DISTINCT | ALL ] expr) [ OVER (analytic_clause) ]
VSIZE(expr)
WIDTH_BUCKET (expr, min_value, max_value, num_buckets)
XMLAGG(XMLType_instance [ order_by_clause ])
XMLCAST ( value_expression AS datatype )
XMLCDATA ( value_expr )
XMLCOLATTVAL (value_expr [ AS { c_alias | EVALNAME value_expr } ] [, value_expr [ AS { c_alias | EVALNAME value_expr } ] ]... )
XMLCOMMENT ( value_expr )
XMLCONCAT(XMLType_instance [, XMLType_instance ]...)
XMLDIFF ( XMLType_document, XMLType_document [ , integer, string ] )
XMLELEMENT ( [ ENTITYESCAPING | NOENTITYESCAPING ] [ NAME ] { identifier | EVALNAME value_expr } [, XML_attributes_clause ] [, value_expr [ [AS] c_alias ]]... )
XMLEXISTS ( XQuery_string [ XML_passing_clause ] )
XMLFOREST ( value_expr [ AS { c_alias | EVALNAME value_expr } ] [, value_expr [ AS { c_alias | EVALNAME value_expr } ] ]... )
XMLISVALID ( XMLType_instance [, XMLSchema_URL [, element ]] )
XMLPARSE ({ DOCUMENT | CONTENT } value_expr [ WELLFORMED ] )
XMLPATCH ( XMLType_document, XMLType_document )
XMLPI ( { [ NAME ] identifier | EVALNAME value_expr } [, value_expr ] )
XMLQUERY ( XQuery_string [ XML_passing_clause ] RETURNING CONTENT [NULL ON EMPTY] )
XMLROOT ( value_expr, VERSION { value_expr | NO VALUE } [, STANDALONE { YES | NO | NO VALUE } ] )
XMLSEQUENCE( XMLType_instance | sys_refcursor_instance [, fmt ] )
XMLSERIALIZE ( { DOCUMENT | CONTENT } value_expr [ AS datatype ] [ ENCODING xml_encoding_spec ] [ VERSION string_literal ] [ NO INDENT | { INDENT [SIZE = number] } ] [ { HIDE | SHOW } DEFAULTS ] )
XMLTABLE ( [ XMLnamespaces_clause , ] XQuery_string XMLTABLE_options )
XMLTRANSFORM(XMLType_instance, { XMLType_instance | string } )
This reference contains a complete description of the Structured Query Language (SQL) used to manage information in an Oracle Database. Oracle SQL is a superset of the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO) SQL:1999 standard.
This Preface contains these topics:
The Oracle Database SQL Language Quick Reference is intended for all users of Oracle SQL.
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc
.
Access to Oracle Support
Oracle customers have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info
or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs
if you are hearing impaired.
For more information, see these Oracle resources:
Oracle Database PL/SQL Language Reference for information on PL/SQL, the procedural language extension to Oracle SQL
Pro*C/C++ Programmer's Guide, Oracle SQL*Module for Ada Programmer's Guide, and the Pro*COBOL Programmer's Guide for detailed descriptions of Oracle embedded SQL
Many of the examples in this book use the sample schemas, which are installed by default when you select the Basic Installation option with an Oracle Database installation. Refer to Oracle Database Sample Schemas for information on how these schemas were created and how you can use them yourself.
The following text conventions are used in this document:
Convention | Meaning |
---|---|
boldface | Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary. |
italic | Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values. |
monospace | Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter. |