Let’s say I’ve got the following scenario
entry 228 is related to category 126,127,128,129 entry 229 is related to category 126 the client wants to show 229 in an exclusive category 126 list
I can’t seem to get EE entries tag to return the right value. What SQL query would get me 229 alone where cat_id = 126?
I figured this out. Maybe will help someone else along the way.
Select e.entry_id as entry from exp_channel_data e inner join (select count(exp_category_posts.entry_id) as thecount, entry_id from exp_category_posts where cat_id <>125 group by exp_category_posts.entry_id) a on e.entry_id = a.entry_id where a.thecount = 3 AND e.channel_id = 17 order by e.field_id_64 asc;
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.