Použijte GROUP_CONCAT()
takhle:
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
Možná budete muset provést ORDER BY d.name
abyste získali přesné pořadí hodnot, jak chcete. Takhle:
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