how to find the second highest salary from emp table?
Answer Posted / aravind naidu
select * from emp e where (select count(*) from emp where sal>=e.sal)=&n; put n = 2 for second highest sal,n = 3 for third highest sal ....and so on.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
what is the difference between union and union all? : Sql dba
How many developers work on postgresql?
What is the difference between inner join and left join?
What does pragma mean?
what are the different type of sql's statements ? : Sql dba
What is asqueryable?
Why schema is used in sql?
How long will it take to learn pl sql?
What is a temporal data type?
How do I debug a stored procedure?
how to get a list of columns in an existing table? : Sql dba
What is the clause we need to add in function body to return variable?
Explain what is sql?
What is sql not null constraint?
What is trigger types of trigger?