Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain optimistic and pessimistic concurrency?

985


Determine how to use the inserted and deleted pseudo tables?

981


How to filter out duplications in the returning rows in ms sql server?

1126


Mention the differences between sql server and mysql.

1005


What happens if the update subquery returns multiple rows in ms sql server?

1117


What is a field name?

955


Explain how to use linked server?

984


What are the different types of subquery?

1146


What do you mean by sql server 2005 express management tools?

1291


How many types of functions are there in sql server?

931


what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?

5913


Can you explain the disadvantages/limitation of the cursor?

974


What is blocking?

1050


How can I track the changes or identify the latest insert-update-delete from a table?

944


How will you decide the active and passive nodes?

1120