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
List all types of constraints in sql server?
What is constraints and its types?
How many databases can we create in a single server?
What are data driven subscriptions?
Can a database be shrunk with users active?
mention different types of relationships in the dbms?
What is right outer join in sql server joins?
Define inner join? Explain with an example?
How to optimize stored procedure optimization?
What happens when unicode strings concatenate with non-unicode strings?
How many replicas are maintained for each sql azure db?
What is the data tier application?
How to edit table in sql server 2017?
how you can get the list of largest tables in a database? : Sql server administration
What is the rdl file?