Re:The Curious Case of the Aggregation Query
by indigo945 on Tuesday December 05, 2023 @11:39AM
(#38533187)
Well, the "fun" one to consider is IMO not that, but this:
SELECT (SELECT sum(a + x) FROM xx LIMIT 1) FROM aa;
Making a pretty diagram where all the behaviours from various DBMSs are listed is left as an exercise to the author. :)
Re:The Curious Case of the Aggregation Query
by foldU on Tuesday December 05, 2023 @11:40AM
(#38533214)
I think this one is obvious actually! There's no choice but to aggregate it at the level of the `xx` `SELECT`, no other level has access to the `x` column.
Re:The Curious Case of the Aggregation Query
by MarkusWinand on Tuesday December 05, 2023 @11:44AM
(#38533276)
> Making a pretty diagram where all the behaviours from various DBMSs are listed is left as an exercise to the author. :)
It's there already!
It's in the chart as footnote "b": Outer reference must be the only argument (doesn’t support F441)
That's the one thing SQL Server doesn't eat. Those that are green in the chart work fine in this case.
[1]: https://buttondown.email/jaffray/archive/sql-scoping-is-surp...