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 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


Please Help Members By Posting Answers For Below Questions

What does normalization do to data?

1051


What is SQL Azure Firewall?

136


What are the different methods available under sqlcommand class to access the data?

1108


What are the events recorded in a transaction log?

988


Tell me what are the advantages of using stored procedures?

998


Can we insert data into a view?

1124


Is port 1433 secure?

988


How to filter records of table in SQL SERVER?

1074


How adventureworkslt tables are related?

919


What is the difference between locking and multi-versioning?

981


What is query processing?

928


what is the difference between delete table and truncate table commands? : Sql server database administration

1023


How to list all user defined functions in the current database?

1031


What is sql server 2000 work load governor?

1048


To which devices can a backup be created and where should these devices be located? : sql server management studio

1030