如何修改此查询?
SELECT column_a,
( SELECT GROUP_CONCAT(column_b)
FROM table_b
WHERE column_b IN (main_tbl.column_a) ) AS alias_a
FROM table_a main_tbl
假设 column_a 的值为 1,2,3。
上述查询的输出与此类似:
SELECT column_a,
( SELECT GROUP_CONCAT(column_b)
FROM table_b
WHERE column_b IN ('1,2,3') ) AS alias_a
FROM table_a main_tbl
我需要的是:
SELECT column_a,
( SELECT GROUP_CONCAT(column_b)
FROM table_b
WHERE column_b IN (1,2,3) ) AS alias_a
FROM table_a main_tbl