O'Reilly logo

Oracle in a Nutshell by David C. Kreines, Rick Greenwald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

SELECT

Synopsis

SELECT [{DISTINCT | UNIQUE | ALL}]
{ [schema.]{table_name. | view. | snapshot.} 
|  expr [[AS] alias][,expr [[AS] alias] ...] 
| *
}
FROM 
{table_name[@dblink] [AS OF {SCN | TIMESTAMP} expr] 
| table_name PARTITION (partition_name) [AS OF {SCN | TIMESTAMP} expr] 
| table_name SUBPARTITION (subpartition_name) [AS OF {SCN | TIMESTAMP} expr] 
| table_name SAMPLE [BLOCK] sample_percent [AS OF {SCN | TIMESTAMP} expr] 
| view[@dblink] [AS OF {SCN | TIMESTAMP} expr]  
| snapshot[@dblink] [AS OF {SCN | TIMESTAMP} expr] 
| (subquery) 
| table_name 
  { [join_type] JOIN table_name
    { ON condition 
    | USING (column [, column]... )
  | { CROSS JOIN | NATURAL [join_type] JOIN table_name }
  } 
[,[table_alias]
[,table_name[@dblink] [AS OF {SCN | TIMESTAMP} expr] 
| table_name PARTITION (partition_name) [AS OF {SCN | TIMESTAMP} expr] 
| table_name SUBPARTITION (subpartition_name) [AS OF {SCN | TIMESTAMP} expr] 
| table_name SAMPLE [BLOCK] sample_percent [AS OF {SCN | TIMESTAMP} expr] 
| view[@dblink] [AS OF {SCN | TIMESTAMP} expr]  
| snapshot[@dblink] [AS OF {SCN | TIMESTAMP} expr] 
| (subquery) 
| table_name 
  { [join_type] JOIN table_name
    { ON condition 
    | USING (column [, column]... )}
  | { CROSS JOIN | NATURAL [join_type] JOIN table_name }
  }
} 
[table_alias]]
[WHERE condition]
{[GROUP BY {expr | {expr[,expr ...]} 
| CUBE (expr[,expr ...]) 
| ROLLUP (expr[,expr ...]) 
}
GROUPING SETS (
  {expr | {expr[,expr ...]} 
  | CUBE (expr[,expr ...]) 
  | ROLLUP (expr[,expr ...])
  } 
[HAVING condition]
[[START WITH condition] CONNECT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required