On 5/6/2019 5:19 PM, Shawn Wagner wrote:
I just found out that postgres (And possibly others?) supports FILTER on
aggregate functions in general, not just when they're used as a window
function.

Trivial example:

     SELECT count(*), count(*) FILTER (WHERE amount > 100) FROM blah

which is a lot cleaner than

     SELECT count(*), sum(CASE WHEN amount > 100 THEN 1 ELSE 0 END) FROM blah

sum(amount > 100)   is sufficient.
--
Igor Tandetnik


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to