from | to generate the data set |
on / join | |
where | to filter interesting records from the data set |
Add pseudo column rownum | Oracle only (See Select first n rows …) |
group by | To specify which rows need to be combined for aggregations |
with cube / with rollup | |
| aggregation functions | to actually perform the calculations on the combined rows |
having | To exclude (aggregated) records |
| Window (analytic) functions | to combine values from different records of the result set |
select | Specify what is actually returned. |
distinct | eliminate duplicates |
Set operatiors (union, intersect, except etc.) | to combine results from multiple select statements |
| Model clause | Oracle only? |
as <alias_name> | Aliases to expressions seem to take effect somewhere here. See also the Oracle error message ORA-00904: invalid identifier. |
order by | to sort the result set |
offset | to specify the first record that should be returned |
limit, fetch, top | to specify how many records should be returned |
Because window functions are performed after aggregation functions, they can use the result of aggregation functions.