Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: cycled order
Fred,
my last answer only gave the birthdays of people in the running year.
This will give you the full results:
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(SYSDATE,'YYYY'),'DD-MON-YYYY')
BIRTHDAY, 2 DUMMY
FROM T
WHERE
TO_DATE(TO_CHAR(D,'DD-MON')||'-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MON-YYYY')
<SYSDATE
ORDER BY DUMMY, BIRTHDAY
You can get rid of the extra dummy column with the SQLplus command COLUMN
OFF.
Received on Fri May 28 1999 - 04:04:12 CDT
![]() |
![]() |