mysql - Joining product attributes table with the product table to display product -
i have 3 tables listing products product attributes
product table dummy data
product_attributes dummy data
attributes dummy data
kespersky antivirus (productid = 1) has no attributes iphone (productid =2) has 2 attributes applicable it, memory , resolution both in attribute table has value stored in product_attribute table.
how join these tables show/display both products there corresponding attributes?
edit
i need display these products
the following work number of attributes:
select product.productid, product.name, group_concat(concat(attr.attributename, ":", pa.attributevalue)) product left outer join product_attributes pa on (pa.productid = product.productid) left outer join attributes attr on (attr.attributeid = pa.attributeid) group product.productid, product.name
Comments
Post a Comment