无法进行mysql查询

时间:2010-11-07 07:14:45

标签: sql mysql

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

在上面的查询中,我希望它不显示我从tr.term_taxonomy_id = tt.term_taxonomy_id获得的结果,如果它等于“cat”。

1 个答案:

答案 0 :(得分:1)

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'