Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to select top n rows from a table?
Hi, everyone I'd like to select the first n rows of a table according to
some reasons. For instance, I need to select the top 10 students with best
scores in a class, by applying just one SQL statement. In fact, my C/S
environment cannot stand the network traffic if I cannot do that neatly at
the server end. I find Oracle privides ROWNUM psuedocolumn but the ORDER BY
clause cannot be used in any subqueries. Do you know how to solve this
problem? Please give me a hand.
Xie Binglong
Image Processing Group, Tsinghua University
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Apr 05 1999 - 07:54:52 CDT