There is more than one way to achieve what you want. Here is one:
"select count(a), COALESCE(sum(a),0) from t"
One could also do it using a CASE statement.
Cheers
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.