1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answers were Sorted based on User's Feedback
Answer / 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 |
How to use user defined functions in expressions?
hi, how to match retrieve the unmatched records from 2 tables in which we dont have any primary key. example : table1 has 1,2,3,4,5 and table2 has 1,2,3,4,5,6,7,8,9,10 and i want the numbers from 6 to 10 to be displayed and should not come as null. i need the numbers. please reply as soon as possible.
What is table join?
mention different types of relationships in the dbms?
SQL Server Performance Tuning for Stored Procedures & reducing debugging time?
1 Answers CarrizalSoft Technologies,
How do I find the sql server version?
Can multiple columns be used in sql group by clause in ms sql server?
What is mapping schema?
What area unit the various kinds of info compression introduced in sql server 2008?
Is it possible to replicate data from sql server to oracle? : sql server replication
What is the difference between a clustered index and a non-clustered index?
what is statistics