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
When would you prefer to have a minimum number of indexes?
What is fill factor and pad index?
What does top operator do?
Can you use order by when defining a view?
How will you go about resolving deadlocks?
what's the information that can be stored inside a bit column? : Sql server database administration
Can we use pragma autonomous_transaction in trigger?
What is difference between inner join and full join?
What are the limitations in ssrs on sql server express edition?
To which devices can a backup be created and where should these devices be located? : sql server management studio
what is bit datatype? : Sql server database administration
Define Joins?
What are the pre-defined functions in the sql server?
What will be query used to get the list of triggers in a database?
How self join is different from outer join?