3 ms·
Or the ultimate pedant (pedultimate?) order which matches the SQL order of operations (which for some queries can be illuminating): from ... where ...
by dugmartin 5y ago
Or the ultimate pedant (pedultimate?) order which matches the SQL order of operations (which for some queries can be illuminating):
from ...
where ...
group ...
having ...
select ...
order by ...
limit ...
- forgetfulness 5y agoStandard SQL and most dialects enforce that in the syntax anyway no? Edit: misread and select was in the middle in that comment
- CamouflagedKiwi 5y agoNo, all databases support the common order of SELECT ... FROM ... WHERE ....
- forgetfulness 5y agoYou're right, I somehow missed that select was in a different order.
- wodenokoto 5y agoIs that legal SQL? I'd love to write in that order. When working in Big Query, it would be so nice to first declare the table, so the online IDE can autocomplete columns.
- throwaway021212 5y agoYou might like QUEL, precursor to SQL (and the original language of Ingres and Postgres) where range variables came first. https://en.wikipedia.org/wiki/QUEL_query_languages#Usage https://en.wikipedia.org/wiki/QUEL_query_languages#Usage