Select From `table1` Where NOT in `table2` ?? [Solved]
Posted: Wed Mar 21, 2007 5:24 pm
I've two tables, basically like this:
images: id, otherinfo...
tags: id, imageid, otherinfo...
Now, I want to select everything in `images` that doesn't have an entry in `tags`
How might I go about that?
Such as...
SELECT * FROM `images` WHERE `images`.`id` is not in `tags`.`imageid`;
Is this easily done? Or should I add another row in the `images` table that says whether or not there have been tags added yet (big hassle)?
images: id, otherinfo...
tags: id, imageid, otherinfo...
Now, I want to select everything in `images` that doesn't have an entry in `tags`
How might I go about that?
Such as...
SELECT * FROM `images` WHERE `images`.`id` is not in `tags`.`imageid`;
Is this easily done? Or should I add another row in the `images` table that says whether or not there have been tags added yet (big hassle)?