How to remove Duplicates and update all relations from PostgreSQL database?

Viewed 81

I'm working on updating a local dataset that has a lot of cases with the following structure:

enter image description here

The elements in table A that share the same refID for the main entity are virtually the same, so I wanna remove all these duplicates and update tables B, C and so on.

The idea is to group all elements in table A that share the same refId, choose one, remove all the others and change the references in other tables to the one I chose. However, I'm having problems with the last part, updating the other tables.

Is there a quick way of doing this? Doing it manually has been a pain

0 Answers
Related