Created
June 28, 2017 20:04
-
-
Save awmpietro/fbee8293b1a53d95b30f55e2244ab314 to your computer and use it in GitHub Desktop.
Group a count of values in specific label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| (case when field not in('value1', 'value2') then 'OUTROS' | |
| when field in('value3') then 'value3' | |
| count(est_des_descricao) as total | |
| FROM | |
| tables | |
| GROUP BY | |
| field DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment