Count each condition within group
问题 For every unique GroupId I would like to get a count of each IsGreen , IsRound , IsLoud condition and a total number of rows. Sample data: ----------------------------------------------------- id | ItemId | GroupId | IsGreen | IsRound | IsLoud ----+--------+---------+---------+---------+--------- 1 | 1001 | 1 | 0 | 1 | 1 2 | 1002 | 1 | 1 | 1 | 0 3 | 1003 | 2 | 0 | 0 | 0 4 | 1004 | 2 | 1 | 0 | 1 5 | 1005 | 2 | 0 | 0 | 0 6 | 1006 | 3 | 0 | 0 | 0 7 | 1007 | 3 | 0 | 0 | 0 Desired result: --------