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 programs use sql?
What is a natural join?
what are ddl statements in mysql? : Sql dba
How to select 10 records from a table?
How to execute a stored procedure?
What is a composite primary key?
What is difference between cursor and trigger?
What is a design view?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba
Can a composite key be null?
What is difference between procedure and trigger?
What does dml mean?
What is normalisation and its types?
what are all different types of collation sensitivity? : Sql dba
How many types of sql are there?