Join Query returns empty result, unexpected result

Posted by Abs on Stack Overflow See other posts from Stack Overflow or by Abs
Published on 2010-04-04T23:29:19Z Indexed on 2010/04/04 23:33 UTC
Read the original article Hit count: 404

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about sql

Related posts about query