Tenho o seguinte sql:
select to_CHAR(dt_atendimento,'MM/YYYY'),
count(*)
from tabela
where dt_atendimento between '01/10/2016' and '11/01/2017'
group by to_CHAR(dt_atendimento,'MM/YYYY')
select to_CHAR(dt_atendimento,'MM/YYYY'),
count(*)
from tabela
where dt_atendimento between '01/10/2016' and '11/01/2017'
group by to_CHAR(dt_atendimento,'MM/YYYY')
select to_char(dt_atendimento,'mm/yyyy'), qtd from (
select trunc(dt_atendimento,'month') dt_atendimento, count(*) qtd
from tabela
where dt_atendimento between '01-10-16' and '11-01-17'
group by trunc(dt_atendimento,'month')
order by trunc(dt_atendimento,'month'))
Usuários navegando neste fórum: Google [Bot] e 15 visitantes