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
How does sql profiler work?
Can we insert data into materialized view?
What is clustered index in sql?
What are records give examples?
What is anonymous block in sql?
what is bcp? When is it used?
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
What is the max nvarchar size?
How to assign sql query results to pl sql variables?
what is 'mysqlshow'? : Sql dba
Explain the steps needed to create the scheduled job?
What is auto increment?
what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba
Is vs as in pl sql?
What is the size of partition table?