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 12:00:05 +0200
Message-ID: <7ilpee$8bv$1@zonnetje.NL.net>


and this will give a better output with the years correct:

SELECT N

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

) >
SYSDATE

UNION
SELECT N
,        TO_DATE(
              TO_CHAR(
               D,'DD-MON')||'-'||
                 TO_CHAR (add_months(SYSDATE,12),'YYYY'),'DD-MON-YYYY'
         ) BIRTHDAY
,        2 dummy
FROM       T
WHERE      TO_DATE(
              TO_CHAR(
               verjaardag,'DD-MON')||'-'||
                  TO_CHAR(add_months(SYSDATE,12),'YYYY'),'DD-MON-YYYY'
           ) <
               add_months(SYSDATE,12)

order by dummy, birthday
/ Received on Fri May 28 1999 - 05:00:05 CDT

Original text of this message

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