2010-11-07 119 views
0
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」。無法進行mysql查詢

+0

哪個字段等於「貓」?請提供一些示例數據。 – 2010-11-07 07:48:29

回答

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'