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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is innodb? : Sql dba

762


How many scalar data types are supported in pl/sql?

716


What is the difference between pl and sql?

737


How exception handling is done in advance pl/sql?

672


Does access use sql?

750






Explain the the delete statements in sql?

756


- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

1581


What is type and rowtype in pl sql?

741


What is the difference between the conventional and direct path loader? : aql loader

867


What is a primary key called that is made up of more than one field?

1027


How do I view output in sql developer?

809


How do you write a subquery?

697


What is the use of <> sql?

738


How to change sql*plus system settings?

721


what is the syntax for using sql_variant_property? : Transact sql

706