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 can you count the number of rows from a table tab?
in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?
Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?
cursor with hold explain ?
In cursor program-1 can we create another cursor program-2 inside the cursor program-1.If yes how/no why ?
What is a db2 schema?
wht displays the number of times a query modified ?
What is a DB2 plan?
What type of database is db2?
What is the difference between db2 and oracle?
Is db2 a database?
what are the max. & min. no. of partitions allowed in a partition tablespace?