1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / rajkumar v
Ans:1
select Column_Name from Table_Name group by Column_Name
having count(Column_Name )>1
Ans:2
salary - column name
SELECT TOP 1 salary FROM (SELECT DISTINCT TOP 2 salary FROM
Table_Name ORDER BY salary DESC) A ORDER BY salary
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
what is a sub-report?
what are the critical issues you have resloved in your company
What are different types of raid levels?
What is the difference between dataadapter and datareader?
What are distinctive joins find as a part of sql?
Ways to improve the performance of a SQL Azure Database?
How to generate create table script on an existing table in ms sql server?
How can I track the changes or identify the latest insert-update-delete from a table?
What are sql dirty pages?
What is serializable?
What is resource db in sql server?
Can you explain the disadvantages/limitation of the cursor?
Explain the properties of the relational tables?
What is NOT NULL Constraint in sql server 2012?
Do you know what is lock escalation?