top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to get Second Maximum Salary in an Organization?

0 votes
91 views
How to get Second Maximum Salary in an Organization?
posted Jul 16, 2014 by Amanpreet Kaur

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

+2 votes
SELECT TOP 1 Salary FROM Employee 
WHERE 
  Salary<(SELECT MAX(Salary)FROM Employee) 
Order BY 
  Salary DESC
answer Nov 17, 2014 by Manikandan J
0 votes

Lack of homework before asking question, looks like that you want to know the second highest number in SQL or MySQL.

Try something like this -

SELECT MAX( col )  FROM table
 WHERE col < ( SELECT MAX( col )  FROM table )
answer Jul 16, 2014 by Salil Agrawal
0 votes

You can try this.
"SELECT max(salary_obtained) FROM organization_tbl WHERE salary_obtained <( SELECT max(salary_obtained) FROM organization_tbl)".

answer Jul 17, 2014 by Karamjeet Singh
Similar Questions
+1 vote

How we can get nth max salary from Employee Table (EMP_ID, Salary)

Emp_id salary
1 1000
3 2000
4 16000
2 10000
7 19000
8 12000

e.g. for 3rd max salary, salary is 12000 so answer will be emp_id : 8

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...