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 are primary key and foreign key and how they work?
What is mutating error in pl sql?
what is the difference between char_length and length? : Sql dba
how is exception handling handled in mysql? : Sql dba
which tcp/ip port does sql server run on? : Sql dba
how is myisam table stored? : Sql dba
What is Materialized View? In What Scenario we Use Materialized View?
list out some tools through which we can draw e-r diagrams for mysql. : Sql dba
What is the difference between the repeatable read and serializable isolation levels? : Transact sql
what are all types of user defined functions? : Sql dba
How bulk collect improves performance?
Can we rollback truncate?
What is hibernate and its relation to sql?
What will you get by the cursor attribute sql%rowcount?
What is cross join example?