|
|
|
|
|
by ErwinSmout
1516 days ago
|
|
Imagine you need to write a query to answer "what are the cities with more than 4000 inhabitants". What more natural could there be than to write this as (old 1992 correlated query style) SELECT cityName FROM Cities C WHERE
((SELECT COUNT() FROM Inhabitants I WHERE I.cityName = C.cityName) > 4000) Agreed ??? YOU CAN'T DO THIS IN SQL [standard version] !!! You must write SELECT cityName FROM Cities C WHERE
(4000 < (SELECT COUNT() FROM Inhabitants I WHERE I.cityName = C.cityName)) This makes SQL about the only language in the world that allows you to write "a<b" in certain places but forbids you to write "b>a" in those very same places. Some professional piece of language design. (Disclaimer : I don't know how matters are in SQL:2016 wrt to this issue, but it drove a former IBM employee who was at the time a member of the SQL standards committee to (a) start work on TTM and (b) leave IBM as soon as he could.) |
|