how to find the second highest salary from emp table?

Answer Posted / chirag shah

select DISTINCT(salary) from emp order by salary desc limit 1,1

this limit gives you 2nd record
if you want 3rd value then write limit 3,1

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which are the different types of indexes in sql?

556


How to rename a table?

556


Can we create table in function?

565


what is self-join? : Sql dba

565


Sql technical questions

775






What are the rules to be applied to nulls whilst doing comparisons?

750


What is the importance of sqlcode and sqlerrm?

845


Can we use distinct and group by together?

586


what is the difference between undefined value and null value? : Sql dba

562


What does the hierarchical profiler does?

566


Explain about various levels of constraint.

519


What is set serveroutput on?

642


who introduced sql?

567


what is an index? : Sql dba

520


Explain cursor types?

578