Jin Bin
Jin Bin

Reputation: 5

Unable to make an mysql query

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

Answers (1)

ajacian81
ajacian81

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

Related Questions