這裏就是我想:MySQL:是否可以對多行進行group_concat?
attribute_name attribute_id attribute_value
--------------------------------------------------------------------
Appliances 16, 17, 18, 19 Washer, Dryer, Dishwasher, Microwave
Consoles 7, 3 PS3, XBox
這裏是靠近我的本錢:
attribute_name attribute_id attribute_value
-------------------------------------------------
Appliances 16 Washer
Appliances 17 Dryer
Appliances 18 Dishwasher
Appliances 19 Microwave
Consoles 7 PS3
Consoles 3 XBox
...從此查詢:
SELECT a.name AS attribute_name,
av.attribute_value_id, av.value AS attribute_value
FROM attribute_value av
INNER JOIN attribute a
ON av.attribute_id = a.attribute_id
WHERE av.attribute_value_id IN
(SELECT attribute_value_id
FROM property_attribute
WHERE property_id = 1)
ORDER BY a.name;
我沒有成功與GROUP_CONCAT。我甚至不知道我想要什麼是可能的。
請出示你實際上是具有一個問題編碼 - GROUP_CONCAT代碼。 –