Mysql
 sql >> Database >  >> RDS >> Mysql

SQL molti a molti selezionare

È una semplice unione interna delle tabelle:

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'