1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / devraj
(1) Query to fetch all duplicate records:
Select * From emp02 Where Rowid Not In (Select Min(Rowid)
From emp02 Group By No, ename, Work)
(2) Query to fetch 2'nd highest salary:
Select * From (Select a.*, dense_rank () Over (Order By sal
Desc) Vb From emp02 a) Where Vb = 2;
| Is This Answer Correct ? | 7 Yes | 12 No |
Post New Answer View All Answers
Can I delete event logs?
Explain various data region available in ssrs with their use?
What is coalesce in sql server?
What stored by the master?
What is user defined datatypes and when you should go for them?
What does the on delete cascade option do?
What is lookup override?
What is cursors?
Can we use max in where clause?
What do you understand by a stored procedure?
what are different types of backups available in sql server? : Sql server database administration
What are acid properties of transaction?
Explain having clause and where clause?
What are the types of database recovery models?
How to use values from other tables in update statements in ms sql server?