Run Code  | Code Wall  | Users  | Misc  | Feedback  | About  | Login  | Theme  | Privacy 

sum vs count with multiple options in group by clause

Language: Layout:
View schema
Execution time: 0,02 sec, rows selected: 15, rows affected: 9, absolute service time: 0,2 sec, absolute service time: 0,21 sec 
edit mode |  history  | discussion
   id Role is_active is_deleted
1 100 SM y n
2 101 SM n y
3 102 SM y n
4 103 BC n y
5 104 BC y n
6 105 BC y n
7 103 AI n y
8 104 AI y n
9 105 AI y n
   Role Total Active Deleted
1 AI 3 2 1
2 BC 3 2 1
3 SM 3 2 1
   Role Total Active Deleted
1 AI 3 3 3
2 BC 3 3 3
3 SM 3 3 3