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
What is the use of partition by in sql?
What are the limitations of sql express?
What is on delete restrict?
how to use regular expression in pattern match conditions? : Sql dba
what is the difference between clustered and non clustered index in sql? : Sql dba
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 ?
what is an extent ? : Sql dba
What is the function that is used to transfer a pl/sql table log to a database table?
Is mariadb nosql?
Can unique keys be null?
Why do we use set serveroutput on?
What is a native sql query?
What is update query?
What is procedure and function?
What is meant by temporal data?