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 purpose of rollback and commit?

1115


How can tablespace be moved to another dasd volume that is allocated for that tablespace?

1197


Name the various locking levels available?

1053


How would you find out the total number of rows in a db2 table?

1005


Explain the function done by data manager?

1233


What is the role of data manager in the db2 database?

1065


What are the bind parameters ibm db2?

1007


How do I delete a table in db2?

1026


Mention the location where the output received from explain statement is stored.

1082


What are the contents of dclgen?

1070


What is lock escalation in db2?

979


Where do you specify them?

1196


How can you quickly find out the # of rows updated after an update statement?

1006


What are foreign keys in db2?

1053


How to connect to db2 database from windows command line?

1019