JOIN
する必要があります users
に テーブルを2回作成し、それらに異なる識別子を指定します(別名エイリアス )各JOIN
SQL内。
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