我正在寻找MySQL中与PostgreSQL函数array和array_to_string相当的函数,但是即使在Google上也找不到任何合适的答案。我需要使用MySQL来实现这一点。以下是一个关于oracle9i的帖子(链接),但对我没有帮助。
为了让你不必读两篇文章,这里是问题的重复:
为了让你不必读两篇文章,这里是问题的重复:
有人有任何关于如何在MySQL中实现这个的想法吗?In PostgreSQL, using the array and array_to_string functions can do the following:
Given the table "people":
id | name --------- 1 | bob 2 | alice 3 | jon
The SQL:
SELECT array_to_string(array(SELECT name FROM people), ',') AS names;
Will return:
names ------------- bob,alice,jon