0
我無法將變量傳遞給子查詢。SQL將變量傳遞給子查詢
我有2個不同的表需要得到所有采訪人員。
現在我的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