update tag_mapping tm
set tm.title_id = (select t.title_parent
from titles t
where t.title_id = tm.title_id)
WHERE EXISTS (select t.title_parent
from titles t
where t.title_id = tm.title_id
and t.title_parent != 0)
This will double up some tags, but that seems less of a problem
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Simple solution:
update tag_mapping tm
set tm.title_id = (select t.title_parent
from titles t
where t.title_id = tm.title_id)
WHERE EXISTS (select t.title_parent
from titles t
where t.title_id = tm.title_id
and t.title_parent != 0)
This will double up some tags, but that seems less of a problem
Fixed in scripts/move_VTs_tags.sql 1.1, installed in r2014-74 on 2014-02-02. Closing.