Using MySQL
, I can do something like:
(使用MySQL
,我可以做类似的事情:)
SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;
My Output:
(我的输出:)
shopping
fishing
coding
but instead I just want 1 row, 1 col:
(但是我只想要1行1列:)
Expected Output:
(预期产量:)
shopping, fishing, coding
The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.
(原因是我要从多个表中选择多个值,并且在所有联接之后,我得到的行比我想要的要多得多。)
I've looked for a function on MySQL Doc and it doesn't look like the CONCAT
or CONCAT_WS
functions accept result sets, so does anyone here know how to do this?
(我在MySQL Doc上寻找了一个函数,它看起来不像CONCAT
或CONCAT_WS
函数接受结果集,所以这里有人知道如何做到这一点吗?)