The views and opinions expressed all for my own,only for study and test, not reflect the views of Any Company and its affiliates.
分类: Oracle
2009-07-08 16:01:10
select是相当的复杂啊。。。。看起来真难
1.
subquery [ for_update_clause ] ;
2.
FOR UPDATE
[ OF [ [ schema. ]
{ table | view } . ]column [, [ [ schema. ] { table | view } . ]column ]... ] [ NOWAIT | WAIT integer ]
3.[ subquery_factoring_clause ]
SELECT [ hint ] [ { { DISTINCT | UNIQUE } | ALL } ] select_list FROM { table_reference [, table_reference ]... | join_clause | ( join_clause ) } [ where_clause ] [ hierarchical_query_clause ] [ group_by_clause ] [ HAVING condition ] [ model_clause ] [ { UNION [ ALL ] | INTERSECT | MINUS } (subquery) ] [ order_by_clause ]
3.
ORDER [ SIBLINGS ] BY
{ expr | position | c_alias }
[ ASC | DESC ]
[ NULLS FIRST | NULLS LAST ]
[, { expr | position | c_alias }
[ ASC | DESC ]
[ NULLS FIRST | NULLS LAST ]
]...
[, query_name AS (subquery) ]...
5.
{ *
| { query_name.*
| [ schema. ]
{ table | view | materialized view } .*
| expr [ [ AS ] c_alias ]
}
[, { query_name.*
| [ schema. ]
{ table | view | materialized view } .*
| expr [ [ AS ] c_alias ]
}
]...
}
6.
{ ONLY
(query_table_expression)
[ flashback_query_clause ]
[ t_alias ]
| query_table_expression
[ flashback_query_clause ]
[ t_alias ]
}
7.
[ VERSIONS BETWEEN
{ SCN | TIMESTAMP }
{ expr | MINVALUE } AND
{ expr | MAXVALUE }
]
AS OF { SCN | TIMESTAMP } expr
8.hierarchical_query_clause
[ START WITH condition ]
CONNECT BY [ NOCYCLE ] condition
.......................