selecionas as datas entre periodos(urgente)

Oracle

21/03/2007

Gostaria de saber como faço para selecionar os meses e anos em um determinado intervalo, por exemplo:

intervalo: nov-06 a fev-07

o resultado tem que ser:

nov-06
dez-06
jan-07
fev-07

Como faço para que isto retorne usando o ´SELECT´?

Desde já Agradeço.


Stgmta

Stgmta

Curtidas 0

Respostas

Motta

Motta

21/03/2007

select *
from tabela
where trunc(data) between to_date(´01-nov-2006´) and to_date(´28-feb-2007´)


GOSTEI 0
Stgmta

Stgmta

21/03/2007

select * from tabela where trunc(data) between to_date(´01-nov-2006´) and to_date(´28-feb-2007´)


mas eu nao quero selecionar de uma tabela, eu quero so informar as datas e pegar os intervalos dela, preciso usar todos os meses do intervalo.
obrigado.


GOSTEI 0
Motta

Motta

21/03/2007

select (to_date(´01-jan_2006´) + rownum - 1) 
from   user_tab_columns
where  rownum <= months_between(´01-jan-2007´,´01-jan_2006´)



GOSTEI 0
Stgmta

Stgmta

21/03/2007

select (to_date(´01-jan_2006´) + rownum - 1) 
from   user_tab_columns
where  rownum <= months_between(´01-jan-2007´,´01-jan_2006´)



GOSTEI 0
POSTAR