SELECT, FROM, JOIN, ON, WHERE, GROUP BY, HAVING, ORDER BY, UNION, LIMIT/OFFSET.SELECT/GROUP BY/ORDER BY go on new lines for readability.( or CASE; decrease before ) or END. Align ON under its JOIN.; are formatted individually.Choose which optional categories you allow. Necessary cookies are always on. Privacy Policy.