Help needed please! I need to grab the entry_id’s relating to cat_id of ’42’, then find all cat_id’s that are attached to the entry_id’s we have just filtered by. I then need to get the cat_group_id of them cat_id’s. See screenshots of tables below:
E.g. entry_id 92 has cat_id 42 assigned to it. But it also has 48 & 71. It's these numbers I need to output. But only if the entry_id is in cat_id 42
I didn't understand very well what you wanted, is it this?
select group_id from exp_categories inner join exp_category_posts on exp_category_posts.cat_id = exp_categories.cat_id where entry_id in (select entry_id from exp_category_posts where cat_id = 42) ;
Note: I didn't create the tables to test it, but I think the query is ok