Gebruik GROUP_CONCAT()
zoals dit:
SELECT k.id, GROUP_CONCAT(d.value)
FROM keywords AS k
INNER JOIN data as d ON k.id = d.id
GROUP BY k.id
Mogelijk moet u ook ORDER BY d.name
. doen om de exacte volgorde van waarden te krijgen zoals u wilt. Zoals dit:
SELECT k.id, GROUP_CONCAT(d.value ORDER BY d.name separator ' ')
FROM keywords AS k
INNER JOIN data as d ON k.id = d.id
GROUP BY k.id