caseステートメントで簡単に実行できます:
SELECT SUM(CASE WHEN FACEBOOKID IS NULL THEN 1 ELSE 0 END) AS NbUsers , 'NO' AS FACEBOOK
FROM USERTABLE
UNION ALL
SELECT SUM(CASE WHEN FACEBOOKID IS NULL THEN 0 ELSE 1 END) AS NbUsers , 'YES' AS FACEBOOK
FROM USERTABLE
caseステートメントで簡単に実行できます:
SELECT SUM(CASE WHEN FACEBOOKID IS NULL THEN 1 ELSE 0 END) AS NbUsers , 'NO' AS FACEBOOK
FROM USERTABLE
UNION ALL
SELECT SUM(CASE WHEN FACEBOOKID IS NULL THEN 0 ELSE 1 END) AS NbUsers , 'YES' AS FACEBOOK
FROM USERTABLE