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
How do I setup a local sql server database?
Disadvantages of the indexes?
How to loop through the result set with @@fetch_status?
What is the default value of an integer data type in sql server 2005?
What are the benefits and tasks of object explorer? : sql server management studio
How to execute function in stored procedure sql server?
What is clr ddl trigger?
What is the library index called?
What are the different types of data sources in ssrs?
How to create stored procedures with parameters in ms sql server?
What is an execution plan? When would you use it?
How to make a remote connection in a database?
How to find table changes in sql server?
How can a database be repaired?
What the difference between UNION and UNIONALL?