最佳答案
您可以加入 users
表两次:
select
u1.name `from`,
u2.name `to`
from gifts g
join users u1 on g.`to` = u1.id
join users u2 on g.`from` = u2.id
where u1.id = 1;
关于mysql - 使用先前查询的结果进行sql查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42178401/