我有以下查詢,我想tags.tag成分隔1列,產品表支點tagtable得到所有標籤在一列
SELECT products.*
FROM products
WHERE product.id IN ('13', '14')
product_tag table
id
product_id
tag_id
tags table
id
tag
期望的結果:
product.name , product.description , tags (colulumn with tags seperated by ,)
....
請參閱https://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_group-concat – Serg