我很惊讶地得到所有存在于category_id中的产品6,3
这个我正在使用。mysql返回记录在哪里条款
select c.product_id from product_to_category c where c.category_id = 6 and c.category_id = 3
此其返回0记录
如果我使用OR
代替AND
,
select c.product_id from product_to_category c where c.category_id = 6 or c.category_id = 3
然后,它返回与6个或3 category_id
任何建议wo不胜感激。
你要6类和3的所有记录?如果是,那么使用'OR'应该这样做。它有什么问题? – mynawaz