我第一次查詢交叉口的MySQL
SELECT ID FROM wp_posts
WHERE post_type = 'post' AND post_status = 'publish'
AND ID IN (Select object_id FROM wp_term_relationships, wp_terms
WHERE wp_term_relationships.term_taxonomy_id =18)
ORDER BY post_date DESC
農產品結果
31 and 28
和我的第二個查詢
SELECT ID FROM wp_posts
WHERE post_type = 'post' AND post_status = 'publish'
AND ID IN (Select object_id FROM wp_term_relationships, wp_terms
WHERE wp_term_relationships.term_taxonomy_id =8)
ORDER BY post_date DESC
會產生
31 and 33
我需要得到兩個查詢result.ie,31
的交集。我們怎樣才能用mysql
偉大謝謝! – abhis 2010-11-12 12:42:07