How to find 3rd highest salary of an employee from the employee table in sql?



How to find 3rd highest salary of an employee from the employee table in sql?..

Answer / Mohammad Badizzamaan

To find the third highest salary, you can use a subquery with the DISTINCT keyword and ORDER BY clause along with LIMIT and OFFSET clauses. Here is an example SQL query:n`nSELECT salaries FROM ( SELECT DISTINCT salaries FROM employee ORDER BY salaries DESC LIMIT 3 OFFSET 1 ) as temp;nThis will return the third highest salary from the employee table.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

How to return multiple rows from the stored procedure?

1 Answers  


Why is there a need for sqlcode and sqlerrm variables?

1 Answers  


Is sql sequential or random?

1 Answers  


What is the source code of a program?

1 Answers  


What is sql in oracle?

1 Answers  


What does dml mean?

1 Answers  


Difference between IN and EXISTS

4 Answers   Nous, Polaris,


what are dynamic queries in t-sql? : Transact sql

1 Answers  


Can we rename a column in the output of sql query?

1 Answers  


What is a dirty read sql?

1 Answers  


What does partition by mean in sql?

1 Answers  


What is the need of a partition key?

1 Answers  


Categories