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
Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.
What is the difference between commit and rollback?
Will sql server 2005 allow you to reduce the size of a column?
What is a trigger in sql server?
How to get the definition of a view out of the sql server?
How to find which stored procedure is currently running in sql server?
Define master database?
What is BLOCK statements in SQL?
What is built-in function?
What are the different types of collation sensitivity in sql server?
What is the difference between functions and stored procedures?
What is the difference between insensitive and scroll cursor?
Are connections to sql server encrypted?
What is acid properties?
What are the aggregate and scalar functions?