T1_Select

543阅读 0评论2009-07-08 lukeunique
分类:Oracle

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 ]
  ]...
4.
WITH query_name AS (subquery)
     [, 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

.......................

上一篇:Other Schema Objects
下一篇:ocp开始行动