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 protocol does sql server use?
How would you choose between a clustered and a non-clustered index?
What is a synonym for manipulation?
What does man by sql wildcard characters in sql server?
can any body tell me how to know the password of current user in sql server
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration
What is sql server 2000 work load governor?
what is blocking? : Sql server database administration
State the difference between union and union all?
What is the most common type of join?
What are the types of database schema? : sql server analysis services, ssas
Explain tablesample?
What is a file group?
How will you decide the active and passive nodes?
What are the types of normalization?