Structure of a SELECT Statement
Overview
This diagram shows the use of the LIMIT clause. This keyword is standard in many SQL dialects, but is not used in Oracle SQL. To achieve the same thing, you would need to write something like:
SELECT ...
...
-- We have to use "FETCH" instead of "LIMIT" here
FETCH FIRST 5 ROWS ONLYWe’ve elected to include the diagram above because we think the main information it provides is so excellent. Just note that the final clause shown should be slightly different when you are working with Oracle SQL.
Depending on how comfortable you are with SQL, the structure of a SELECT command can be hard to remember. However, you can get quite far when writing queries by knowing the order and significance of a few important clauses.
The overview shown by Figure 1 is a great reference for the most important components of a SELECT statement. It shows you:
- A succinct reference for the order of the most important keyword clauses
- For example, your
FROMkeyword should come before aGROUP BYkeyword
- For example, your
- A visual reference that shows what each clause does to your table
- An approximate reference for the order of operations that Oracle follows
- For example, Oracle performs
WHEREfiltering before it does aggregations specified by yourGROUP BYclause
- For example, Oracle performs
The Official, Comprehensive Structure

If you want to know the official, authoritative structure for a SELECT statement in Oracle SQL, you can find it in Oracle’s documentation.
This isn’t a great place for learning how to do things, but it can be useful for understanding the “structure” inherent in SQL. Consult it if you’re doing anything complex and you need to know whether something is possible at all.