Fórum Tratamento Data Select #618183
06/06/2022
0
Quero gerar uma query:
Select
to_char(data_inicio,''''mm - yyyy''''),
count(data_inicio)
from
eventos_1
where
data_inicio between to_date(''''01/01/2020'''''''',''''dd/mm/yyyy'''') and (sysdate)Resultado está vindo assim:
01/2020 - 19
01/2020 - 02
02/2020 - 20
Como devo fazer pra que ele conte todos as datas de janeiro 2020?
Marco Sousa
Curtir tópico
+ 0Posts
06/06/2022
Emerson Nascimento
Select
to_char(data_inicio,''''mm - yyyy''''),
count(*)
from
eventos_1
where
data_inicio between to_date(''''01/01/2020'''''''',''''dd/mm/yyyy'''') and (sysdate)
group by
to_char(data_inicio,''''mm - yyyy'''')Gostei + 0
06/06/2022
Marco Sousa
Select
to_char(data_inicio,''''''''mm - yyyy''''''''),
count(*)
from
eventos_1
where
data_inicio between to_date(''''''''01/01/2020'''''''''''''''',''''''''dd/mm/yyyy'''''''') and (sysdate)
group by
to_char(data_inicio,''''''''mm - yyyy'''''''')Sim, esqueci de copiar o Group by quando postei minha duvida, mas ele apresenta desta forma
01/2020 - 19
01/2020 - 02
02/2020 - 20
Gostei + 0
06/06/2022
Emerson Nascimento
select
to_char(data_inicio,'mm - yyyy'),
count(*)
from
eventos_1
where
data_inicio between to_date('01/01/2020','dd/mm/yyyy') and (sysdate)
group by
to_char(data_inicio,'mm - yyyy')Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)