IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to fetch the duplicate rows in a table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Tue Dec 27, 2005 2:46 pm
Reply with quote

Can anyone tell me how to fetch

how to fetch the duplicate rows in a table
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Dec 27, 2005 7:36 pm
Reply with quote

Duplicate on what... Complete ROW ?????

Primery Key field wont have duplicates....

Regards,

Priyesh.
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Tue Dec 27, 2005 8:07 pm
Reply with quote

Say for example u want to remove duplicates for col_A,

select col_A, count(*) from table
group by col_A
having count(*) > 1

the same can be used if you want to group by more than one column, say col_a, col_b etc.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top