我无法将变量传递给子查询。
我有两张不同的桌子,需要所有面试人员。
当前我的 SQL
SELECT
empl.id AS id,
(SELECT
GROUP_CONCAT(interviewed_by SEPARATOR ', ')
FROM
(
SELECT
interview_old.interviewed_by
FROM
interview_old
WHERE
interview_old.empl = empl.id
UNION
SELECT
interview.interviewed_by
FROM
interview
WHERE
interview.empl = empl.id
)
as interviewed_by
) AS interviews
FROM
empl AS empl
这不是我的完整代码,所以我无法更改这部分
SELECT
empl.id AS id,
{only here allow insert custom sql}
FROM
empl AS empl