MySQLで UPDATE – JOIN – GROUP BY する

UPDATE persons as t1
INNER JOIN (
	SELECT person_id ,GROUP_CONCAT(name SEPARATOR ' ') as alias
	FROM personaliases
	GROUP BY person_id
) as t2
ON t1.id = t2.person_id
SET t1.aliases = t2.alias;