我有一个这样的mysql表
PRODUCT
-------
product_id: 1 | name: product .... product_id: 2 | name: product2 .. etc etc
然后我有另一张桌子
PROPERTY
---
id: 1 | name: red | product_id: 1 .... id: 2 | name: large | product_id: 1 ..... id: 3 | name : brown | product_id: 2 .... and so on ...
如何选择具有 2 个属性的产品?
例如,我想购买具有 RED 和 LARGE 属性的产品
我试过
SELECT * FROM product
JOIN property USING (product_id)
WHERE property.name = "red" AND property.name = "large" ....
但显然它不起作用:)
感谢您的帮助,对不起我的英语!