Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL Help (Art Table)
Hi,
I have a table art_table as follows
ART_TABLE
(ART_ID NUMBER(10), ART_DATE DATE, ART_DESC VARCHAR2(200))
I have data in the table as follows
AAA 01-20-2000 AAA Desc AAA 01-21-2000 AAA Desc AAA 01-22-2000 AAA Desc AAA 01-23-2000 AAA Desc AAA 01-24-2000 AAA Desc BBB 01-20-2000 BBB Desc BBB 01-21-2000 BBB Desc BBB 01-22-2000 BBB Desc BBB 01-23-2000 BBB Desc BBB 01-24-2000 BBB Desc
I want the result set should be sorted by ART_ID and ART_DATE and show only the latest 3 rows. SO in our example the result set should be
AAA 01-24-2000 AAA Desc AAA 01-23-2000 AAA Desc AAA 01-22-2000 AAA Desc BBB 01-24-2000 BBB Desc BBB 01-23-2000 BBB Desc BBB 01-22-2000 BBB Desc
I am using Oracle 8.0.5.
Any help will be very helpfull.
Thank you very much.
Prabha.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Jan 24 2000 - 12:12:15 CST
![]() |
![]() |