how to find the second highest salary from emp table?
Answer Posted / vijay kintali
select e1.ename,e1.sal from emp e1 where n=(select count
(distinct e2.sal) from emp e2 where e1.sal<=e2.sal);
Note:n here is nth highest salary.......
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is union?
Can you inner join the same table?
Is sql a dbms?
What are basic techniques of indexing?
what does myisamchk do? : Sql dba
What are the different datatypes available in PL/SQL?
What is meant by <> in sql?
Why should I use postgresql?
Explain normalization and what are the advantages of it?
Is it mandatory for the primary key to be given a value when a new record is inserted?
Is there a way to automate sql execution from the command-line, batch job or shell script?
Is nosql relational?
What is index example?
Why indexing is needed?
What are the different types of joins in sql?