I have a table with the below data:
ID Cat Rat Rabbits
001 A B D
002 A C E
003 B A A
004 A E B
005 D A B
006 B C A
I want to count the # of A,B,C,D and E's from each column.
Code:
SELECT cat,sum(Abs(cat="A" or "B" or "C" or "D")) as Cat_Tot from sample group by cat