是否存在与PostgreSQL array_to_string等效的MySQL [英] Is there a MySQL equivalent to PostgreSQL array_to_string
本文介绍了是否存在与PostgreSQL array_to_string等效的MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试找到与PostgreSQL函数 array 和 array_to_string 等效的MySQL,并遇到了
I'm trying to find the MySQL equivalent of the PostgreSQL functions array and array_to_string and came across this post but asking for oracle9i which doesn't help me. I need to achieve this with MySQL but even Google can't seem to find any suitable answers.
因此您不必阅读两篇文章,这是一个重复的问题:
So you don't have to read two posts, here is a repeat of the question:
在PostgreSQL中,使用array和array_to_string函数可以执行以下操作:
In PostgreSQL, using the array and array_to_string functions can do the following:
给表人":
id | name
---------
1 | bob
2 | alice
3 | jon
SQL:
SELECT array_to_string(array(SELECT name FROM people), ',') AS names;
会返回:
names
-------------
bob,alice,jon
任何人都有如何在MySQL中实现此目标的想法吗?
Anyone have any ideas how to achieve this in MySQL?
推荐答案
尝试 查看全文