RE: Retreving last n records

RE: Retreving last n records

 

  

Hi Balvinder,
This can solve your problem.
Select * from (select * from tab_name order by BILLDATE desc)
Where row mun <= 3;

Thanks & Regards
Rajeev Sharma
R-Systems International
+919911755571


-----Original Message-----
From: Balvinder Singh
[mailto:oracledba-ezmlmshield-x67905289.[Email address protected]
Sent: Tuesday, October 09, 2007 1:51 PM
To: LazyDBA Discussion
Subject: 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



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Oracle LazyDBA home page