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
How to sort the rows in sql.
What is the difference between a primary key and a unique key?
What are the most important characteristics of pl/sql?
What is the use of function in sql?
Can we use update in sql function?
In a distributed database system, can we execute two queries simultaneously?
Can we rollback delete command?
Explain what is a column in a table?
What are the different types of functions in sql?
Explain locks? : Transact sql
what is a unique key ? : Sql dba
What is parameter substitution in sql?
what is the difference between truncate and drop statements? : Sql dba
Explain dml and ddl?
What is pivot in sql?