我在 MySQL 表上有这些数据cart
。
我想运行一个输出如下的查询:
Advance Technique Conditioner (2), Advance Technique Gel (1)
所以我正在做一个group_concat
查询,并试图查询输出我想要的输出。这是输出最接近所需的查询:
select concat(group_concat(product separator ', '), group_concat(quantity separator ', ')) as 'prod' from cart where debt_no='0000001'
但正如预期的那样,它的输出如下:Advance Technique Conditioner, Advance Technique Gel2, 1
如何获得所需的输出?