select
cnt_N = sum(CASE WHEN P.ID =1 OR P.ID=4 OR P.ID=22 OR P.ID=2 then 1 else 0 end) ,
cnt_Y = sum(CASE WHEN P.ID =1 OR P.ID=4 OR P.ID=22 OR P.ID=2 then 0 else 1 end)
from MAIN P
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
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.