连接 sql 行

concat sql rows

假设我在 table

中有这些行
hello
guys
how
are
you?

我的预期结果是这样一行:

hello, guys, how, are, you?

我能做什么?

正如 GordonLinoff 在评论中提到的,GROUP_CONCAT 有效。

我不知道你的 table 名字或 table 结构,但你可以这样做:

SELECT GROUP_CONCAT(col_name) FROM table WHERE ...

你可以阅读about it here.