select TOTALAMOUNT,BILLDATE,DUEDATE from
(select rownum rw ,TOTALAMOUNT,BILLDATE,DUEDATE from table_name order
by billdate desc)
where rw <=3
Warm Regards,
Manoj Krishnan.A
"Balvinder
Singh "
<oracledba-ezml To
mshield-x679052 "LazyDBA Discussion"
89.[Email Address Removed] <[Email address protected]
LazyDBA.com> cc
10/09/2007 Subject
02:09 PM Retreving last n records
Hi,
Pls suggest a query that How can I retrieve a last three
transactions/records on the basis of BILLDATE?
TOTALAMOUNT BILLDATE DUEDATE
------------ --------- ---------
352 05-FEB-06 24-FEB-06
293 05-APR-06 26-APR-06
376 05-JUN-06 26-JUN-06
453 05-OCT-06 25-OCT-06
368 05-DEC-06 26-DEC-06
367 05-JAN-07 26-JAN-07
519 05-FEB-07 26-FEB-07
I want to retrieve the last 3 bills from the above records.
regards
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page