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 2 resolve the -311 sqlcode
What is package in db2 mainframe?
What is buffer pool and list some of them?
What is the usage of open cursor command?
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
wht is d/f between union and joins ?
pls explain the precompilation process of cobol-db2 pgm
what needs to be done if a table is in copy pending / check pending status?
how to check the table is empty or not?
What is a clustering index ?
What is scrollable cursor in db2?
What is release/acquire in bind?