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 |
What is the difference between SYNONYM and ALIAS?
What does an outer join do?
What will the FREE command do to a plan?
What is bufferpool in db2?
wht are the restrictions for union ?
What is a view? Why use it?
why we create view.
What is the difference between using bind () and rebind () methods of naming class?
What is the difference between dbm cfg and db cfg file in db2 ?
In which column of which DB2 catalog would you find the length of the rows for all tables?
For update of a row in cursors, when do we move value into host variable in cobol progrm? is it before open or before fetch ?
What is a precompiler?