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 / dewesh
With cte as (
Select *, Dense_rank() over (order by salary desc) as s from emp)
Select EmpName, Salary from cte where s =2
It has work. But duplicate value is not removed if name is different
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
What is the process of debugging?
What is the best partition size for windows 10?
What is pls_integer in pl sql?
Are stored procedures compiled?
How to fetch alternate records from a table?
How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?
How do I remove sql developer from windows 10?
Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?
What is the difference between delete and truncate commands?
How to revise and re-run the last sql command?
Is subquery faster than join?
What is pl sql quora?
Is sql open source?
Can we call a function containing dml statements in a select query?