Home » SQL & PL/SQL » SQL & PL/SQL » how fetch top 10 row from table
how fetch top 10 row from table [message #217261] Thu, 01 February 2007 06:20 Go to next message
victoryhendry
Messages: 95
Registered: January 2007
Location: Bangalore
Member

how fetch top 10 row from table
Re: how fetch top 10 row from table [message #217263 is a reply to message #217261] Thu, 01 February 2007 06:22 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You should search the site. This has been talked about millions of times.

BTW...an EXPERT solution isn't required.
Re: how fetch top 10 row from table [message #217407 is a reply to message #217261] Fri, 02 February 2007 01:28 Go to previous messageGo to next message
haikasi
Messages: 7
Registered: October 2006
Junior Member
if my understanding is not wrong
select * from <table-name> where rownum<11
Re: how fetch top 10 row from table [message #217409 is a reply to message #217407] Fri, 02 February 2007 01:31 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Quote:
if my understanding is not wrong
select * from <table-name> where rownum<11


That returns 10 random rows.
Search this site for top-n
Re: how fetch top 10 row from table [message #217410 is a reply to message #217407] Fri, 02 February 2007 01:31 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
Well, it depends on how you define top...
Based on rownum you get the first 10 rows that Oracle kind of randomly comes up with.
So, first define what is "top" and than search for top-10 on this forum or the FAQ.

Regards,
Sabine
Re: how fetch top 10 row from table [message #217494 is a reply to message #217410] Fri, 02 February 2007 09:16 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Topic Closed. There are lots of solutions all over the board. Even the FAQ pages address this issue Wink

http://www.orafaq.com/forum/fa/448/0/

MHE
Previous Topic: Help with Query
Next Topic: How to create a directory object dynamically (Merged)
Goto Forum:
  


Current Time: Fri Dec 09 04:09:22 CST 2016

Total time taken to generate the page: 0.16467 seconds