How to retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / ashok

select sal from emp order by sal desc offset 1 rows fetch next 1 rows with ties;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of partition by in sql?

519


What are the limitations of sql express?

530


What is on delete restrict?

544


how to use regular expression in pattern match conditions? : Sql dba

529


what is the difference between clustered and non clustered index in sql? : Sql dba

551






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 ?

538


what is an extent ? : Sql dba

584


What is the function that is used to transfer a pl/sql table log to a database table?

557


Is mariadb nosql?

586


Can unique keys be null?

488


Why do we use set serveroutput on?

518


What is a native sql query?

498


What is update query?

551


What is procedure and function?

520


What is meant by temporal data?

546