I have a table with 20 columns and each row can have a value of 0-4 (integer) in each column.
I would like to count the number of 0's, the number of 1's, the number of 2's etc in each column for a given subset of the table which is specified in the where clause.
A friend suggested PARTITION
, but that's not supported in SQL Server CE. I suspect that I have to use count(expression)
but I can't work out what the expression would be.
Can anyone give me a suggestion?
Thanks, Will.