Anda harus JOIN
kepada users
tabel dua kali, dan beri mereka pengenal yang berbeda (alias alias ) pada setiap JOIN
dalam SQL Anda.
SELECT
comment,
userFrom.username AS commentFrom,
userTo.username AS commentTo
FROM comments
JOIN users AS userFrom ON userFrom.ID = comment.commentFrom
JOIN users AS userTo ON userTo.ID = comment.commentTo