Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: selecting records
Hi,
Try this :
SELECT /*+ RULE */ * FROM YOUR_TABLE T, DUAL D
WHERE SYSDATE - T.YOURDATEFIELD = DECODE(D.DUMMY(+),NULL,NULL) AND ROWNUM <
11
ORDER BY T.YOURDATEFIELD DESC
HTH,
Philippe
G. Kakisina wrote in message <78kb1f$9dm$1_at_freyja.bart.nl>...
>Hi,
>
>I want to select several records using rownum. This works fine but it
doesnt
>work properly with 'ORDER BY'. It doesn't show the records i want.
>For example; I want to select the ten newest records from my table. The
>table contains a date field.
>How can i do this?
>
>G. K.
>
>
Received on Wed Jan 27 1999 - 07:15:55 CST