Hi,
I have table called stats
. In am inserting yes
or no
in the table, and I want to show the number of yes count and the number of no count.
Can somebody please help me with the query?
Hi,
I have table called stats
. In am inserting yes
or no
in the table, and I want to show the number of yes count and the number of no count.
Can somebody please help me with the query?
Try something like this
SELECT SUM(CASE WHEN recommend = 'Y' THEN 1 ELSE 0 END) YesCount,
SUM(CASE WHEN recommend = 'N' THEN 1 ELSE 0 END) NoCount,
COUNT(*) TotalCount
FROM Stats