2015-12-12 16:23 GMT+01:00 Igor Tandetnik <igor at tandetnik.org>: > On 12/12/2015 9:18 AM, Cecil Westerhof wrote: > >> But I want something like: >> ? SELECT >> (SELECT COUNT(*) FROM proverbs) AS Total >> , (SELECT COUNT(*) FROM proverbs WHERE NOT used IS NULL) AS Used >> , (Total - Used) AS Free >> > > select count(*) Total, > sum(used is not null) Used, > sum(used is null) Free, > sum(any_boolean_condition) CountSatisfyingCondition > from proverbs;
?I like this one especially. Thanks. -- Cecil Westerhof