how to find the second highest salary from emp table?
Answer Posted / manikishore
select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal);
//if you want to retrieve 3rd max(sal) then you can use 3 in place of 2,,,like that for so on..
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Which command is used to delete a trigger?
What is the difference between python and sql?
Is postgresql a server?
What is an invalid partition table?
What is the difference between clustered and non-clustered indexes?
Which is faster count (*) or count 1?
What are sql functions? Describe in brief different types of sql functions?
What is the difference between a subquery and a join?
How many joins in sql?
What plvcmt and plvrb does in pl/sql?
What is sp_helptext?
Is truncate ddl or dml?
What sql does db2 use?
What are different types of triggers?
What is data control language (dcl)?