▲ | mattmanser 6 days ago | |||||||||||||||||||||||||
It's because it's logically in the wrong order, it should be:
They use the right order in a lot of ORMs and as I was a SQL expert (but not master), I found it so jarring at first.You probably have the reverse problem, it doesn't fit your mental model which is in fact the right logical model. It gets even worse when you add LIMIT/TOP or GROUP BY. SQL is great in a lot of ways, but logically not very consistent. And UPDATE now I think about it, in SQL Server you get this bizarreness:
| ||||||||||||||||||||||||||
▲ | skydhash 6 days ago | parent | next [-] | |||||||||||||||||||||||||
That's because in the relational model, you deal mostly in terms of projections. There's an action and then the rest of the statement is creating the projection of the data the action will apply to. The action always applies to the whole of the projection (IIRC).d The semantics of SQL and a standard programming language are quite different as they are based on different computing/data model. | ||||||||||||||||||||||||||
▲ | cultofmetatron 6 days ago | parent | prev [-] | |||||||||||||||||||||||||
you would LOVE ecto. its an elixir dsl for writing sql and fixes all the issues I have with sql including what you just mentioned here | ||||||||||||||||||||||||||
|