Write a query to find second highest salary of an employee.

Answer Posted / sathish p

select e1.* from (select ename,sal,rank()
over(order by sal) rank from emp) e1
where e1.rank=2;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which one is faster ienumerable or iqueryable?

482


What are analytical functions in sql?

537


What are the disadvantages of not performing database normalization?

593


Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?

534


how to increment dates by 1 in mysql? : Sql dba

539






what is the syntax used for partition in tsql? : Transact sql

534


explain the options of myisamchk to improve the performance of a table. : Sql dba

545


what are the different index configurations a table can have? : Sql dba

566


Can 2 queries be executed simultaneously in a distributed database system?

640


How many postgresql users are there, worldwide?

578


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

551


What are the various restrictions imposed on view in terms of dml?

518


How to add a column ‘salary’ to a table employee_details?

584


how to include numeric values in sql statements? : Sql dba

555


how many ways to get the current time? : Sql dba

526