Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Challenge ! Find a query doing...
"Laurence TERRAS" <laurence.terras_at_digitech.fr> a écrit dans le message news:
9n00k1$7go$1_at_d03.completel.fr...
> sorry .... for this mistake
>
> the end of the challenge...
> So, the query would be able to give meYears and Months between 2 dates.
> (with dual table or I don't know ....)
>
> D1 = '22/09/2001' (DD/MM/YYYY)
> D2 = '15/05/2002' (DD/MM/YYYY)
>
> I'd like to get
>
>
> YYYY MM
> ------------------
> 2001 09
> 2001 10
> 2001 11
> 2001 12
> 2002 01
> 2002 02
> 2002 03
> 2002 04
> 2002 05
>
> Thanks and sorry for this horrible english...
>
> Laurence
>
>
> "Laurence TERRAS" <laurence.terras_at_digitech.fr> a écrit dans le message
> news: 9n0026$79j$1_at_d03.completel.fr...
> > Hello !
> >
> >
> > I'd like to fing a query wich be able to give Years and Months between 2
> > dates.
> > For example.
> > D1 = '22/09/2001' (DD/MM/YYYY)
> > D2 = '15/05/2002' (DD/MM/YYYY)
> >
> > results...
> >
> >
> >
v815> select to_char(add_months(trunc(to_date('22/09/2001','DD/MM/YYYY'),
2 'MONTH'), 3 rownum-1), 4 'YYYY MM') "YYYY MM"5 from all_objects
7 trunc(to_date('22/09/2001','DD/MM/YYYY'), 8 'MONTH') 9 ))+110 /
YYYY MM
9 rows selected.
-- Regards MichelReceived on Mon Sep 03 2001 - 08:57:00 CDT