how to find the second highest salary from emp table?

Answer Posted / ayush

select *
from (select ename,empno,salary,dense_rank()over(order by
salary desc) rank from emp)
where rank =2

Is This Answer Correct ?    19 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we rename a column in the output of sql query?

537


how to install mysql? : Sql dba

575


Where is pl sql used?

512


What is sql*loader and what is it used for? : aql loader

612


How do you delete duplicates in sql query using rowid?

531






Can dml statements be used in pl/sql?

569


What is raw datatype in sql?

546


What is sqlca in powerbuilder?

556


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

500


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 ?

529


What operators deal with null?

602


What is a ddl command?

527


Why do we need a foreign key?

542


Is sql port 1433 encrypted?

566


What is the command used to fetch first 5 characters of the string?

876