Hello,
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.
The above query works for single column.
Output sample.
Cat Count Rat Count Rabbits Count
A 2 A 2 A 1
B 2 B 1 C 2
Can anyone help with this please?
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
Output sample.
Cat Count Rat Count Rabbits Count
A 2 A 2 A 1
B 2 B 1 C 2
Can anyone help with this please?
Comment