how to find the second highest salary from emp table?

Answer Posted / shalina bajaj

select sal from emp a
where $number = (select count(distinct(sal))
from emp b
where a.sal <= b.sal);

Is This Answer Correct ?    11 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is trigger and how to use it in sql?

548


What is the maximum size of sqlite database?

556


What is mutating sql table?

617


What is cte sql?

525


What is indexing oracle sql?

568






how to create a new table by selecting rows from another table in mysql? : Sql dba

572


Can we use having without group by in sql?

561


What is sqlerrm?

559


What is the use of %rowtype?

546


What is the purpose of a sql?

536


Is not null in sql?

570


What is meant by <> in sql?

515


Does sql support programming?

566


Explain normalization and what are the advantages of it?

525


Which is better trigger or stored procedure?

510