When you use SQL you have to obey certain rules. Below I show you SQL Clauses list with logical (not physical execution) order of sql clauses or in other words sequence of clauses that you should follow in order to successfuly execute SQL statement.
SELECT -- which you use to specify the fields or calculated fields you want to return
FROM -- which you use to specify table or tables you want to use and usually includes joins.
WHERE -- which you use to filter rows
GROUP BY -- used to grouped together values using field or expression you specified
HAVING -- filters group by results with aggregate function (doesn't work on row by row basis like WHERE)
ORDER BY -- used to specify results order
The above our basic SQL Clauses in order you should use them. You don't have to use all of them but there are certain rules you should also follow:
To get full access to this page
Become a member or Sign in
Membership is just $3.99/month