Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将作为子查询结果的多行转换为 MySQL 中的字符串?
我的意思是以下查询:
SELECT id, FUNCTION_THAT_CONVERTS_MUTLIPLE_ROWS_TO_STRING( SELECT name FROM test2 t2 where t2.id = t.id ) FROM test t;
其中SELECT name FROM test2 t2 where t2.id = t.id返回多行。
SELECT name FROM test2 t2 where t2.id = t.id
是的,您需要使用GROUP_CONCAT。