Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/count.sql Secret

Created Nov 22, 2020
Embed
What would you like to do?
select alguna_columna, otra_columna,
sum(case when columna_importante = 'valor' then 1 else 0 end) as conteo_valor,
sum(case when columna_importante = 'otro_valor' then 1 else 0 end) as conteo_otro_valor
from tabla
group by alguna_columna;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.