1
第一个表SQL加入多个ID的
|product_name | category_ids |
|---------------------------------|
|- apple | 1, 2 |
|- extra_apple | 1, 3 |
二表
|category_id | category_name |
|---------------------------------|
|- 1 | fruit |
|- 2 | cheap |
|- 3 | expensive |
我怎样才能加入这个,所以我得到这样的事情
| product_name | category_names |
--------------------------------------------
| apple | fruit, cheap |
| extra_apple | fruit, expensive |
这里真正的解决方法是修复你的不规范化的表设计。 –