SELECT DataOwner ; SUM(CASE WHEN intvalue=1 THEN 1 ELSE 0 END) AS cnt1 SUM(CASE WHEN intvalue=2 THEN 1 ELSE 0 END) AS cnt2 ... SUM(CASE WHEN intvalue=11 THEN 1 ELSE 0 END) AS cnt11 FROM mytable GROUP BY DataOwner>What is the best way to count the total number of occurences of values that reside in the same column. I want to get these counts as 1 row grouped by owner.
>1's in Col 1 >2's in Col 2 >3's in Col 3 >etcs >Example >Number of 1's Number of 2's Number of 3's >21 42 84