0
I have a table called tb.teste
which has 4 columns: status
, categoria
, mês
and tier.
And in each column, accept the following values:
status (novo, usado, pós venda)
categoria (venda, não venda, aberto)
mês (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
tier (T1, T2, T3, Outro)
I want to return the results of a count of the following query:
mês = '1', tier = 'T1', status = 'novo' e categoria = 'venda'
did so:
select count(*) as contagem_1 from tb_teste
where mes = 1 and status = 'novo' and categoria = 'venda' and tier = 'T1';
So far so good... select me returned the count when all fields meet these conditions...
But I wanted to return in a table of the different results of all possible combinations...
Can someone help me?