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 |
What is the diff between Static Queries and Dynamic queries give me some examples
How ssrs maintain security?
What is the difference between index seek vs. Index scan?
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
Explain the storage models of OLAP?
How global temporary tables are represented and its scope?
Which data type can be used only on OUTPUT parameters of the stored proceduer?
When would you prefer to have a minimum number of indexes?
Can we hide the definition of a stored procedure from a use?
What are cursors in ms sql server?
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
what is a cursor and what is its use?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)