Hello all,
Can anyone explain why this query returns an empty result.
SELECT *
FROM (`bookmarks`)
JOIN `tags` ON `tags`.`bookmark_id` = `bookmarks`.`id`
WHERE `tag` = 'clean'
AND `tag` = 'simple'
In my bookmarks table, I have a bookmark with an id
of 70 and in my tags table i have two tags 'clean' and 'simple' both that have the column bookmark_id
as 70. I would of thought a result would have been returned?
How can I remedy this so that I have the bookmark returned when it has a tag of 'clean' and 'simple'?
Thanks all for any explanation and solution to this.
Update
My tag table holds many tags. A bookmark can have many tags. id
in the bookmarks table and the bookmark_id
in the tags table are linked.