Home » SQL & PL/SQL » SQL & PL/SQL » SQL queries . find second largest salary of emp.
SQL queries . find second largest salary of emp. [message #12463] Fri, 21 May 2004 11:14 Go to next message
prashant
Messages: 122
Registered: September 2000
Senior Member
find a employ & it's salary having second largest salary from table having it's name ,salary &other info.
Re: SQL queries . find second largest salary of emp. [message #12465 is a reply to message #12463] Fri, 21 May 2004 11:36 Go to previous messageGo to next message
Art Metzer
Messages: 2478
Registered: December 2002
Senior Member
Re: SQL queries . find second largest salary of emp. [message #12493 is a reply to message #12463] Sun, 23 May 2004 22:01 Go to previous messageGo to next message
srinu
Messages: 4
Registered: April 2002
Junior Member
hi
select * from emp a where 1=(select count(distinct
sal) from emp b);
Re: SQL queries . find second largest salary of emp. [message #12892 is a reply to message #12465] Wed, 09 June 2004 22:55 Go to previous messageGo to next message
santosh kumar singh
Messages: 1
Registered: June 2004
Junior Member
select max(salary) from employee where salary < (select max(salary) from employee)
Re: SQL queries . find second largest salary of emp. [message #215902 is a reply to message #12463] Wed, 24 January 2007 04:28 Go to previous messageGo to next message
v.prasad85
Messages: 1
Registered: November 2006
Location: Hyderabad
Junior Member



HI Friend,

Here i am giving my answer for ur query. Please find this.

select * from emp where
sal = (select max(sal) from emp where
sal < (select max(sal) from emp))

According to my view It is obsolutely correct.
Re: SQL queries . find second largest salary of emp. [message #215903 is a reply to message #215902] Wed, 24 January 2007 04:31 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Why don't we let this old thread rest? Wink

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

MHE
Previous Topic: how delete last 10 records from the table
Next Topic: An index with no referances to actual rows
Goto Forum:
  


Current Time: Sun Dec 04 21:00:15 CST 2016

Total time taken to generate the page: 0.23646 seconds