next up previous
Next: Conceptual Order of Evaluation Up: QUERYING IN SQL Previous: Group By/ Having clauses

Full Select Statement Syntax

Subselect General Form:

select [all|distinct] expression {, expression}
from tablename [corr_name] {, tablename [corr_name]}
[where search_condition]
[group by column {, column}]
[having search_condition]

Full Select General Form:

{union [all] Subselect}
[order by result_column [asc|desc] 
          {, result_column [asc|desc]}]

The order by clause comes at the end and is used to sort the result of a query based on column values.

Raj Sunderraman
Tue Apr 1 16:15:10 PST 1997