Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: cycled order

Re: cycled order

From: Frans Hovenkamp <Dieze_at_popin.nl>
Date: Fri, 28 May 1999 10:27:09 +0200
Message-ID: <7ilk06$422$1@zonnetje.NL.net>

Fred Ruffet heeft geschreven in bericht <7ijr8h$fr4$1_at_gatekeeper.ornano.kapt.com>...
>Hi everyone,
>
>Here's a little problem. I have a table T with a key K, a name N and a
>birthdate D. I would like to do a select that would give me the list of all
>people ordered by birthdate in the year (I mean that 2-jan-1960 is after
>1-jan-1960, and also after 1-jan-1970). This list would begin on the
today's
>date.
>
>if I have this list :
>
>01-sep-1960
>15-aug-1964
>17-jan-1968
>23-may-1974
>24-nov-1974
>
>and we are the 27 april, it would return :
>
>15-aug-1964
>01-sep-1960
>24-nov-1974
>17-jan-1968
>23-may-1974
>
>Pretty, isn't it ?
>Thanks for any help,
>
>Hi Fred

I don't think you need two tables, and a plain to_char conversion will not work.
I hope this solution will work for you: SELECT N
,
TO_DATE(TO_CHAR(D,'DD-MON')||'-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MON-YYYY')

                      BIRTHDAY

FROM T
WHERE
TO_DATE(TO_CHAR(D,'DD-MON')||'-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MON-YYYY')
                        >SYSDATE

ORDER BY BIRTHDAY good luck
Frans Received on Fri May 28 1999 - 03:27:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US