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.
通常我们使用 concat_ws 将 2 个字段连接到同一张表上的 1 个字符串中,我如何进行查询以从其他表中选择字段值?
GROUP_CONCAT(CONCAT_WS(' - ', item1_from_this_table, item_2_from_other_table) SEPARATOR '\n')
是否可以?
加入表,然后(如果不明确)对列引用进行表限定:
SELECT GROUP_CONCAT( CONCAT_WS(' - ', t1.item, t2.item) SEPARATOR '\n' ) FROM t1 JOIN t2 ON ...