SELECT A.id, A.testid, A.question, B.questionid, B.variant FROM questions AS A LEFT JOIN variants AS B ON B.questionid = A.id WHERE A.testid='1'
SELECT
q.id,
q.testid,
q.question,
q.id,
GROUP_CONCAT(v.variant, '; ')
FROM questions AS q
LEFT JOIN variants AS v ON v.questionid = q.id
WHERE q.testid='1'
GROUP BY q.id