我有这个 SQL 查询;
SELECT prod.* FROM bb_admin.bb_directory_products as prod
LEFT JOIN bb_admin.bb_map_product_category as mapcat ON prod.product_id = mapcat.product_id
LEFT JOIN bb_admin.bb_categories_products as cat ON mapcat.category_id = cat.category_id
LEFT JOIN bb_admin.bb_map_product_tag as maptag ON prod.product_id = maptag.product_id
LEFT JOIN bb_admin.bb_tags as tag ON maptag.tag_id = tag.tag_id
WHERE (prod.status='1' OR prod.status='3' OR prod.status='5')
AND prod.is_catalogue='1' AND cat.slug = 'barongs-suits'
AND tag.title IN ('gray','classic')
GROUP BY prod.product_id
我想要的是显示带有“灰色”和“经典”标签的产品。
我试过AND tag.title = 'gray' AND tag.title = 'classic'
了,但效果不好。
谢谢!