File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Get Maximum sal from emp table
Joined: Jul 15, 2006
Aug 04, 2006 04:15:00
How to get second maximum sal from emp table... for example
from this table i want to get the second maximum sal example data : 50 6000, can you reply anybody...
Thanks in Advance
Joined: Mar 02, 2006
Aug 04, 2006 04:39:00
order by salary and take the second record (or to be exact cycle through the results after the order by and take the second unique value, in order to avoid the first value appearing multiple times).
Joined: Jul 10, 2004
Aug 09, 2006 08:47:00
select max(sal) from emp a where 2=(select count(distinct(sal)) from emp b
I agree. Here's the link:
- it saves me about five hours per week
subject: Get Maximum sal from emp table
find second largest value in a column
How to get top 3 earners in emp table of SCOTT's schema using SQL
SQL query help
inner / sub / inline query
second highest value
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013