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
What is the stuff?
What are different type of Collation Sensitivity?
How would you go about developing a ssrs report?
What is standby servers? Explain types of standby servers.
What is a dbms wizard?
Explain activity monitors
Can we write trigger for view?
what exactly sql injuction.how to overcome.....
How to find the version of sql server? : sql server database administration
How do I save a stored procedure in sql server?
explain different levels of normalization? : Sql server database administration
What is a hint?
What are system databases into sql server (2005/2008) : sql server database administration
What is your recommendation for a query running very slow? : sql server database administration
What stored by the msdb? : sql server database administration