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

Suppose there are many duplicate records in a Db2 table.
What is the query to retrive only duplicate records?

Answer Posted / azharuddinsyed

SELECT <COLUMN_1> FROM TABLENAME
GROUP BY COLUMN_1
HAVING COUNT(COLUMN_1) > 1

OR

SELECT <COLUMN_1> FROM TABLENAME
GROUP BY COLUMN_1
HAVING COUNT(*) > 1

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between dbm cfg and db cfg file in db2 ?

1528


What does db2 blu stand for?

1160


How do I add a column to an existing table in db2?

1028


I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.

2057


How to connect to db2 database from windows command line?

1059


Explain about rct.

1084


Explain package in db2 and its advantages?

1203


What is ibm db2 database?

998


How do I delete a column in db2?

1104


What is buffer pool and list some of them?

1019


What is load replace in db2?

992


If I have a view which is a join of two or more tables, can this view be updateable?

1139


Define sqlca.

1103


How many databases can be created inside an instance in db2 ?

1029


Is schema the same as database?

1053