Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL Help (Art Table)

SQL Help (Art Table)

From: <pchapp_at_sapient.com>
Date: Mon, 24 Jan 2000 18:12:15 GMT
Message-ID: <86i4lp$pb5$1@nnrp1.deja.com>


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

Original text of this message

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