.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Others >> Post New QuestionBookmark and Share Subscribe to Forum

How to get top 5 records from Oracle databse table?

Posted By: Dhivakaran     Posted Date: October 26, 2010    Points:2   Category :Others
How to get top 5 records from Oracle databse table based on condition?

Responses
Author: Syed Shakeer Hussain             
Posted Date: October 26, 2010     Points: 5   

Hi,

select TOP 5  Header_id from tableName Order by Header_id desc 


Author: Dhivakaran             
Posted Date: October 26, 2010     Points: 5   

Hi Syed,

There is no top keyword in oracle DB...

-
Dhivakaran T
Author: Syed Shakeer Hussain             
Posted Date: October 26, 2010     Points: 5   

Hi,

SELECT *
FROM (select * from suppliers ORDER BY supplier_id DESC) suppliers2
WHERE rownum <= 5
ORDER BY rownum;


Author: Dhiraj Ranka             
Posted Date: October 26, 2010     Points: 5   

Try this

SELECT column FROM table
WHERE ROWNUM <= 10

Hope this helps.

Thanks & Regards,
Dhiraj Ranka
http://www.twitter.com/dhirajranka | http://www.dhirajranka.com


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend