Hi All,
I want to delete duplicates records from a table, suppose 4 records are duplicate then out of 4 3 we have to delete, can anyone give me that Query???
need a query to delete duplicate records from a table
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: need a query to delete duplicate records from a table
Hello and welcome to the forum,
One way would be to unload the table (thereby creating a backup in case there are problems), remove the duplicates in batch using your sort product, then reload the non-duplicates back into the table.
You would also need to provide a clear definition of what constitutes a duplicate.
One way would be to unload the table (thereby creating a backup in case there are problems), remove the duplicates in batch using your sort product, then reload the non-duplicates back into the table.
You would also need to provide a clear definition of what constitutes a duplicate.
Hope this helps,
d.sch.
d.sch.
-
- Posts: 2
- Joined: Wed Nov 05, 2008 3:25 pm
- Skillset: JCL,COBOL,CICS,DB2,VSAM
- Referer: website
Re: need a query to delete duplicate records from a table
U can use" DISTINCT" to remove duplicacy
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: need a query to delete duplicate records from a table
Hello,
Please post the query that will delete duplicates from a table using distinct. . .U can use" DISTINCT" to remove duplicacy
Hope this helps,
d.sch.
d.sch.
-
- Posts: 4
- Joined: Tue Nov 04, 2008 11:31 am
- Skillset: cobol, jcl, db2, cics, vsam
- Referer: friends
Re: need a query to delete duplicate records from a table
Hi Pooja,
Distinct is not going to update any thing, it only shows the non duplicate records without updating the table.
Distinct is not going to update any thing, it only shows the non duplicate records without updating the table.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
strategy: partitioned table, delete millions of rows
by BobHarris » Wed Aug 17, 2022 2:47 pm » in DB2 - 1
- 1950
-
by engh
View the latest post
Tue Sep 20, 2022 1:56 pm
-
-
- 4
- 2250
-
by sergeyken
View the latest post
Mon Jun 26, 2023 12:56 am
-
-
Finding duplicate in variable lenght string in cobol
by kanipriya2785 » Fri Jun 17, 2022 10:02 pm » in IBM Cobol - 8
- 3470
-
by sergeyken
View the latest post
Wed Jun 22, 2022 3:10 am
-
-
- 1
- 2308
-
by Robert Sample
View the latest post
Fri Feb 25, 2022 7:42 pm
-
- 1
- 5674
-
by enrico-sorichetti
View the latest post
Fri Dec 10, 2021 5:23 pm