This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes How to get top 3 earners in emp table of SCOTT's schema using SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to get top 3 earners in emp table of SCOTT Watch "How to get top 3 earners in emp table of SCOTT New topic
Author

How to get top 3 earners in emp table of SCOTT's schema using SQL

Taqi Hasan
Greenhorn

Joined: Aug 16, 2000
Posts: 24
Hello
can any one tell me
How to get top 3 earners in emp table of SCOTT's schema using SQL.
I would appreciate for your prompt reply.
Regards.
Taqi
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
select a.ename from ( select ENAME , sal, rownum rowval from emp order by sal desc) a where rownum < 4;
Taqi Hasan
Greenhorn

Joined: Aug 16, 2000
Posts: 24
Thanks Lee for your kind information.
Regards.
Taqi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get top 3 earners in emp table of SCOTT's schema using SQL
 
Similar Threads
Top N Analysis
Tax Cuts
JPA named native query
database
Please help me in creation of tables