I have been assigning categories to articles and I have a multi level parent child relationship
level 1
level 1.2
level 1.2.3
Currently the level 1 is set as the primary category, and the other categories as secondary.
I want the level 1.2.3 to be the primary.
when I set then via the "list and edit entries" window I can set 1.2.3 to be the primary, but as 1.2.3 is already set as a secondary then I get everything twice in the category archive.
I can see how to fix this by editing the mt_placement table, but my SQL is not strong enough to make me feel comfortable doing this.
I want to do something like the following, ideally within PHPMyAdmin.
CODE
SELECT *
FROM `mt_placement`
WHERE `placement_blog_id` =1
ORDER BY `placement_entry_id` ASC
LIMIT 0 , 30
FROM `mt_placement`
WHERE `placement_blog_id` =1
ORDER BY `placement_entry_id` ASC
LIMIT 0 , 30
lists the table sorted by entry, I want to identify where the same category is assigned as primary and secondary and then remove the secondary one.
so some thing like
for each placement_entry_id
list placement_category_id
if placement_category_id occurs twice for the entry
then select the one where placement_is_primary=1
and delete it.
repeat for the next entry
is this possible in SQL
any help much appreciated
thanks
Gavin