zlacker

[parent] [thread] 2 comments
1. garret+(OP)[view] [source] 2024-08-29 04:59:18
> Sounds a bit like "new thing scary" unless you show why having select in front actually avoids problems

This isn't really fair. BeefWellington gave a reason why SQL is how it is (and how it has been for ~50 years). It's reasonable to ask for a compelling reason to change the clause order. Simon's post says it "has always been confusing", but doesn't really explain why except by linking to a blog post that says that the SQL engine (sort of but not really) executes the clauses in a different order.

I think the onus of proof that SQL clauses are in the wrong order is on the people who claim they're in the wrong order.

replies(1): >>Sankoz+h4
2. Sankoz+h4[view] [source] 2024-08-29 05:52:02
>>garret+(OP)
But it has been explained many times from many angles.

* SELECT first makes autocomplete hard

* SELECT first is the only out of order clause in the SQL statement when you look at it from execution perspective

* you cannot use aliases defined in SELECT in following clauses

* in some places SELECT is pointless but it is still required (to keep things consistent?)

Probably many more.

replies(1): >>bvrmn+pr
◧◩
3. bvrmn+pr[view] [source] [discussion] 2024-08-29 10:15:22
>>Sankoz+h4
> you cannot use aliases defined in SELECT in following clauses

Some DBs allow it or allow it partially. It's a major constant friction factor for me to do a guess work across different database systems.

[go to top]