SELECT
query:
| WITH withItem [ , withItem ]* query
| {
select
}
[ ORDER BY orderItem [, orderItem ]* ]
[ LIMIT [ start, ] { count | ALL } ]
[ OFFSET start { ROW | ROWS } ]
withItem:
name
[ '(' column [, column ]* ')' ]
AS '(' query ')'
orderItem:
expression [ ASC | DESC ] [ NULLS FIRST | NULLS LAST ]
select:
SELECT [ DISTINCT ] [/*+ hints */]
{ * | projectItem [, projectItem ]* }
FROM tableExpression
[ WHERE booleanExpression ]
[ GROUP BY { groupItem [, groupItem ]* } ]
[ HAVING booleanExpression ]
[ WINDOW window_name AS ( window_definition ) [, ...] ]
projectItem:
expression [ [ AS ] columnAlias ]
| tableAlias . *
tableExpression:
tableReference [, tableReference ]*
| tableExpression [ ( LEFT ) [ OUTER ] ] JOIN tableExpression [ joinCondition ]
joinCondition:
ON booleanExpression
| USING '(' column [, column ]* ')'
tableReference:
tablePrimary
[ [ AS ] alias ]
tablePrimary:
[ catalogName . ] tableName
| '(' query ')'
groupItem:
expression
| '(' expression [, expression ]* ')'ORDER BY
Query Hints
Syntax
Hint
Details
Example
Hint
Details
Example
Cross-Database Queries
Example
Last updated
Was this helpful?

