Reputation: 5
SELECT DISTINCT
tr.object_id,tt.taxonomy, im . *
FROM
term_relationships AS tr
INNER JOIN term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
INNER JOIN image AS im ON tr.object_id = im.ID
In the above query I want it not to display the results I get from tr.term_taxonomy_id = tt.term_taxonomy_id
if it's equal to "cat".
Upvotes: 0
Views: 73
Reputation: 7569
SELECT DISTINCT
tr.object_id,tt.taxonomy, im . *
FROM
term_relationships AS tr
INNER JOIN term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
INNER JOIN image AS im ON tr.object_id = im.ID
WHERE taxonomy != 'cat'
Upvotes: 1