Blurbs ansible coffeescript django dvcs erlang es6 hg javascript json lua mercurial peewee postgresql python scope sql sqlalchemy yaml

FILTER clause code postgresqlsql

SELECT COUNT(*) AS total, COUNT(*) FILTER (WHERE i % 2 != 0) AS odd
FROM generate_series(1, 10) AS s(i);

--  total | odd
-- -------+-----
--     10 |   5
-- (1 row)