Suppose there are many duplicate records in a Db2 table.
What is the query to retrive only duplicate records?
Answers were Sorted based on User's Feedback
Answer / gouri
select column_1 from tablename groupby column1 having coun(*)>1
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / chidambara subbu
SELECT City FROM Customers
Group by City
HAVING COUNT(City) > 1
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sanj
say col1 is having duplicates in table tabA.Then,
select col1 from tabA
group by col1 having (count(col1) > 1)
| Is This Answer Correct ? | 4 Yes | 4 No |
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 |
How will you delete duplicate records from a table?
What is scrollable cursor in db2?
Can you access the DB2 Directory table using SQL?
What is EXPLAIN?
What is multi row fetch in db2?
What is cursor stability?
What is a composite index and how does it differ from a multiple index?
Explain correlated sub-queries.
What will the COMMIT accomplish?
Which transaction use a command thread ?
What is db2 look?
the dd name for ksds is dest1 and what is the dd name for alternate index of ksds ? a.dest b.dest1 c.dest1a d.dd1