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
Explain how dts is used to extract, transform and consolidate data?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What are the properties of primary key?
How do I make a resultset scrollable?
What is the name of the system variable that returns the number of rows affected by a SQL statement?
Mention the differences between local and global temporary tables.
What can be used instead of trigger?
What is DCL?
Describe in brief databases and sql server databases architecture.
Can you name some of the dml commands in sql?
How to rebuild indexes with alter index ... Rebuild?
Can a table be created inside a trigger?
What is an identity?
What are the general features of sql server management studio? : sql server management studio
What do you mean by 'normalization'?