category_product --------------- id_category id_product product --------------- id_product id_manufacturer manufacturer --------------- id_manufacturer name
解决方法
这是一个简单的内部连接表:
SELECT m.name,cp.id_category FROM manufacturer as m INNER JOIN product as p ON m.id_manufacturer = p.id_manufacturer INNER JOIN category_product as cp ON p.id_product = cp.id_product WHERE cp.id_category = 'some value'