Home » SQL & PL/SQL » SQL & PL/SQL » Combine Duplicates
Combine Duplicates [message #37390] Tue, 05 February 2002 04:52 Go to next message
Rich Petersen
Messages: 22
Registered: February 2002
Junior Member
Hello all,

I have just started my PL/SQL studies, but this is well above my current experience.

I have a table called MAINFOLDER, with, among other things, has a NAME and a FOLDER_ID table. This FOLDER_ID is a foreign key in the BINDER table.

The customer has run a load multiple times, and now they have duplicates within the MAINFOLDER table. SO lets say we have a NAME/FOLDER_ID as follows:

NAME1 5
NAME1 6

And in the BINDER table, we have the same column, FOLDER_ID.

I have to delete one of the folders:

Delete from MAINFOLDER where FOLDER_ID=6

then I have to go to the BINDER table and update it, and set the deleted FOLDER_ID to the one that still exists:

UPDATE BINDER SET FOLDER_ID=5 where FOLDER_ID=6.

However, I have to do this numerous times, since they have many duplicate folders. Also, some folders have more than one duplicate.

Anyway to do this with a script?
Re: Combine Duplicates [message #37391 is a reply to message #37390] Tue, 05 February 2002 04:59 Go to previous message
Rich Petesen
Messages: 1
Registered: February 2002
Junior Member
Oopps...wrong forum...I will repost in newbies...

Sorry
Previous Topic: why a parameter type number can get default 0?
Next Topic: Re: Updation using SQL loader
Goto Forum:
  


Current Time: Fri Mar 29 08:46:22 CDT 2024