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

Removing unnecessary duplicate records


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

New User


Joined: 21 Feb 2005
Posts: 6
Location: India

PostPosted: Thu Feb 24, 2005 11:19 am
Reply with quote

hi friends,



Have a nice day to you all.

I have one doubt in db2. Can anyone help me.

Question:-

In a Table there are many duplicate records. I want to delete the duplicate records, at the same time i want to maintain each one copy in that duplicate records. I want to know the query for this.would you please help me?????????. bye.


Rajesh.
Back to top
View user's profile Send private message
khannay2k

New User


Joined: 24 Feb 2005
Posts: 28
Location: Bangalore

PostPosted: Thu Feb 24, 2005 2:38 pm
Reply with quote

[color=darkblue][/color]
Hi Rajesh,
rajesh here again.
this is the syntax to remove the duplicates.

[b]Delete From Table1Where Id In (Select Id From Tabel1 As Temp Group By Id Having Count(*) >1) [/b]

Khanna
Back to top
View user's profile Send private message
rajkan24

New User


Joined: 21 Feb 2005
Posts: 6
Location: India

PostPosted: Sat Feb 26, 2005 9:38 pm
Reply with quote

hi khanna,



thanks for your reply.Are sure with ur query?.Did u check it whether its working or not?.please reply bye.


regards,
R.Rajesh.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top