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
what happens if null values are involved in expressions? : Sql dba
Does sql*plus also have a pl/sql engine?
What is graph sql?
Is there a 64 bit version of ssms?
Which are sql * plus commands?
What are character functions in sql?
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba
Explain the select statement in sql?
Is not null in sql?
How to select all records from the table?
Explain the uses of a database trigger?
How do you update a value in sql?
What are the three forms of normalization?
What is primary key and foreign key?
How do I order by ascending in sql?