SELECT in ISO/IEC-standard SQL prescribes the following syntactical order for the sub-clauses:
SELECT projection-expressions FROM sources WHERE predicate-expression GROUP BY key-expression HAVING predicate-expression ORDER BY ordering-expressions
While the actual execution order is this:
FROM sources WHERE predicate-expression GROUP BY value-expression HAVING value-expression SELECT projection-expressions ORDER BY ordering-expressions
To novice users of SQL it becomes surprising that a projection defined in the
SELECT clause is not available in the
GROUP BY clauses even though it’s declared first – given that computer programs generally follow the top-down execution order.
It’s also surprising that SQL authors are required to repeat their expressions in
GROUP BY clauses redundantly or use a subquery which does not lend itself to a succinct query. At least when the user is familiar with the actual clause execution order they know why they need to repeat themselves, but that doesn’t stop it being frustrating.
This problem, and other related issues, is documented in this article I found: https://blog.jooq.org/2016/12/09/a-beginners-guide-to-the-true-order-of-sql-operations/ and it’s no surprise that a QA on StackOverflow has almost 30,000 views: https://stackoverflow.com/questions/3241352/using-an-alias-column-in-the-where-clause-in-postgresql
It made me wonder if any implementations of SQL allow for this more “logical” ordering of clauses. I note that Linq in .NET does actually follow this order, though I wouldn’t describe it as being a true SQL implementation, but indeed, in Linq the equivalent would be:
source // FROM equivalent .Where( predicate-expression ) .GroupBy( key-expression ) .Where( predicate-expression ) // HAVING equivalent .Select( projection-expression ) .OrderBy( ordering-expression )
(I also like how Linq lets you add a
Select() projection anywhere in the command sequence so you can use your evaluated expressions without needing to invoke expressions again).
So, do any SQL implementation let you express queries in a more logical structure?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!