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 p.ColumnName from tablname p group by p.ColumnName
ans2:
Select min(salary)FROM emp WHERE (salary IN (SELECT
TOP 2 salary FROM emp ORDER BY salary DESC))
Or
Select top 1 salary from (select top 2 salary from emp
order by salary desc) emp order by salary
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain optimistic and pessimistic concurrency?
Determine how to use the inserted and deleted pseudo tables?
How to filter out duplications in the returning rows in ms sql server?
Mention the differences between sql server and mysql.
What happens if the update subquery returns multiple rows in ms sql server?
What is a field name?
Explain how to use linked server?
What are the different types of subquery?
What do you mean by sql server 2005 express management tools?
How many types of functions are there in sql server?
what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?
Can you explain the disadvantages/limitation of the cursor?
What is blocking?
How can I track the changes or identify the latest insert-update-delete from a table?
How will you decide the active and passive nodes?