Re:The SQL filter clause: selective aggregates
by driusan on Monday May 30, 2016 @11:21AM
(#11801703)
I think the most well-thought-out explanation I've seen for why widespread support for the SQL standard seemed to stop after SQL-92 is this one:
Re:The SQL filter clause: selective aggregates
by Xophmeister on Monday May 30, 2016 @11:58AM
(#11801879)
This was quite interesting; thank you for posting... I may be cheeky and submit it to HN.
Re:The SQL filter clause: selective aggregates
by driusan on Monday May 30, 2016 @12:24PM
(#11801981)
I'm fairly sure I originally saw it on HN.
Re:The SQL filter clause: selective aggregates
by MarkusWinand on Monday May 30, 2016 @08:40AM
(#11801005)
I see the value of FILTER mostly in ease to read and understand.
Many things — e.g., Pivot — can be understood way more easily using FILTER rather than CASE.
My guess is that such extensions, while useful, are somewhat marginalised features in terms of usage. Thus, no one ever learns them formally and just Googles for what they need -- if it comes up -- and get the CASE solution, in this case (pun unintentional). Hence perpetuating that pattern. Also, of course, the CASE solution is a lot more powerful as the returned expression, that gets fed into the aggregate function, can be basically anything.