I have a table transcription
which contains passages of transcribed text and their citations with columns:
text, transcription_id(PK), t_notes, citation
and the second table town_transcription
being the relationship table that links places (from another table) referenced in the text to that transcription record. This table has the columns:
town_id(FK), transcription_id(FK), confidence_interval
Many of these passages of text reference multiple towns, but stupidly I just duplicated records and linked them individually to each town. I have identified the duplicate rows of text using the following SQL query:
SELECT * FROM transcription aa
WHERE (select count(*) from transcription bb
WHERE (bb.text = aa.text) AND (bb.citation = aa.citation)) > 1
ORDER BY text ASC;
I now have about 2000 rows (2 to 6 duplicates of some text passages) where I need to delete the extra transcription_id
's from the transcription
table and change the transcription_id
from the relationship table, town_transcription
, to point to the remaining, now unique, transcription record. From reading other questions, I think utilizing UPDATE FROM
and INNER JOIN
might be necessary, but I really don't know how to implement this, I'm just a beginner, thanks for any help.