Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Can this be done in SQL ?
If the results of a query return a list of items sorted by date, is there
anyway of selecting the last 'n' items from the list before a given date.
For example, if the results of the query are,
Item ID Date ===== ==== 1 1/1/99 2 1/4/99 3 1/8/99 4 1/10/99 5 1/12/99
An example query might be to return the ID's of the 2 items with a date prior to 1/9/99 which should return ID's 2 and 3.
Can this be done in one SQL statement ??
Thanks,
Matt. Received on Mon Jun 14 1999 - 13:11:05 CDT
![]() |
![]() |