Something like
SELECT *
FROM images
WHERE id NOT IN (SELECT image_id FROM pivot);
Should work
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I'm not sur of what kind of relation i put on my pivot table ?
I have to allow users tags/rates images according to one category , so I have 3 tables :
users images categories
plus, the pivot table with those foreign keys : user_id, image_id and category_id
So, My question is :
How find images untagged/unrated by user ?
Thank you!
Please or to participate in this conversation.