Tangential, but I never understood why SQL puts the FROM after the SELECT. It's extra confusing because sometimes people want to use aliased fields from the SELECT section in the FROM section but that won't work because its not evaluated in that order. It also makes much more sense to first name the table, then its fields.
There's no real reason. I suspect it would be a very small change to some SQL implementations to allow the various clauses of queries to come in any order.
Comments
Tangential, but I never understood why SQL puts the FROM after the SELECT. It's extra confusing because sometimes people want to use aliased fields from the SELECT section in the FROM section but that won't work because its not evaluated in that order. It also makes much more sense to first name the table, then its fields.
There's no real reason. I suspect it would be a very small change to some SQL implementations to allow the various clauses of queries to come in any order.
The sparksql dialect does allow the from clause to come first, actually.