du skal tilmelde dig creator_updater
tabel to gange, så du kan få navnene på de to kolonner.
SELECT a.id,
b.name created_by_id,
c.name latest_updated_by_id
FROM student_data a
INNER JOIN creator_updater b
ON a.created_by = b.id
INNER JOIN creator_updater c
ON a.updated_by = c.id
men koden ovenfor virker ikke, hvis en af kolonnerne er nullable , hvis det er tilfældet, brug LEFT JOIN
i stedet for INNER JOIN
SELECT a.id,
b.name created_by_id,
c.name latest_updated_by_id
FROM student_data a
LEFT JOIN creator_updater b
ON a.created_by = b.id
LEFT JOIN creator_updater c
ON a.updated_by = c.id
For mere information om joins