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
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
subject: Get Maximum sal from emp table
How to get top 3 earners in emp table of SCOTT's schema using SQL
inner / sub / inline query
second highest value
SQL query help
find second largest value in a column
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014