1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / amit kumar
(1) Query to fetch 2'nd highest salary:
Select max(sal) from emptable where sal not in (Select
max(sal) from emptable)
(2) How to fetch all the duplicate records from the table.
SELECT COUNT(*), <COLUMN_NAME> FROM EDUCATION GROUP BY
<COLUMN_NAME>
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
What is wide table?
Can you leave a union at any time?
How do you delete a data source?
What is rolap and its advantage? : sql server analysis services, ssas
what is the system function to get current user's user id? : Sql server database administration
What is difference between inner join and full join?
What are the diifferences between the ms sql server vs mysql?
Explain Capacity planning to create a database? and how to monitor it?
How to find tables without indexes?
Explain the categories of stored procedure i.e. System stored procedure, local stored procedure, temporary stored procedure, extended stored procedure, remote stored procedure?
What samples and sample databases are provided by microsoft?
Explain indexes disadvantages?
How to stop a loop early with break statements in ms sql server?
Can you explain what is the use of custom fields in report?