SELECT [predicate] * | fieldlist
FROM tablespec
[WHERE wherepredicate]
[GROUP BY groupfieldlist
[HAVING havingpredicate]]
[ORDER BY orderfieldlist]
The purpose of each part is summarized below:
| Part | Purpose |
| * | Specifies that all possible data columns are returned. |
| predicate | Restricts the data rows returned, e.g. to avoid duplicates |
| fieldlist | The list of fields returned by the query |
| tablespec | Specifies the tables that contain the data, together with the necessary inter-table relationships. |
| wherepredicate | Specifies one or more conditions that must be true for each returned data row |
| groupfieldlist | Specifies grouping for the returned data. |
| havingpredicate | Specified one or more conditions that must be true for each returned data group |
| orderfieldlist | Specifies the data's order within each group. |