News for hackers. Stuff that matters.
Re:The SQL filter clause: selective aggregates by Xophmeister on Monday May 30, 2016 @08:35AM (#11800985)
Syntactic sugar that's only natively supported in PostgreSQL? The site's banner says, "A lot has changed since SQL-92". Be that as it may, but it seems no one has really bothered catching up. I wonder why that is...

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.

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:

http://www.wiscorp.com/is_sql_a_real_standard.pdf

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.

Re:The SQL filter clause: selective aggregates by baq on Monday May 30, 2016 @04:27PM (#11802988)
and in js transpilers are bread and butter tech. sql isn't as cool i guess.