Forum

Please or Register to create posts and topics.

Duplicate Media Tags: Person & Citation

I have lots (I mean LOTS) of people who have media that are tagged to both the person and a citation for an event.  Is there any way to get rid of the person tags without editing each person and removing them one by one????

I am using RM 7.  I've tried the MediaTags-DeletePersonalHavingFactDupes.sql but get zero results.

Thanks so much!

 

 

Using SQL, yes. These would be records in the MediaLinkTable which have a common MediaID for OwnerType of 0 and 4. This query should list all such MediaID:

SELECT MediaID FROM MediaLinkTable
WHERE OwnerType=0 -- Person
INTERSECT
SELECT MediaID FROM MediaLinkTable
WHERE OwnerType=4 --Citation
;

Then it's simply a matter of deleting those records having a MediaID in this list and Ownertype=0.

Ali Christie-Upton has reacted to this post.
Ali Christie-Upton

So I would just save what you sent above as a new sql script and execute it in sqlitespy?  or sqlite personal?  And how do I delete the records in the list?  Where will the list be?   Sorry .... I really don't understand sql very well and don't know how to do anything except execute pre-written scripts 🙂  Thanks so very much for your help!

Either SQLite manager will do. Make sure you have a backup copy of your database in case I've made a mistake or misunderstood.

This script should do it (I've not tested it):

DELETE FROM MediaLinkTable
WHERE OwnerType=0
AND MediaID IN
(
SELECT MediaID FROM MediaLinkTable
WHERE OwnerType=0 -- Person
INTERSECT
SELECT MediaID FROM MediaLinkTable
WHERE OwnerType=4 --Citation
)
;

Ali Christie-Upton has reacted to this post.
Ali Christie-Upton

It worked beautifully!!!!!!!!!!!!!!  Thank you soooo much!  Jaime

Tom Holden has reacted to this post.
Tom Holden