I can't pass variable to subquery.
I have 2 different tables where need get all interview persons.
Current my 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
It's not my full code, so I can't change this part
SELECT
empl.id AS id,
{only here allow insert custom sql}
FROM
empl AS empl