我目前有
select * from A where A.id not in
(select B.id from B where B.user ='b') and A.user <> 'b'
如何更改此查询以使用JOIN
- 例如LEFT JOIN user AS last_replied_user ON topic.last_replied_by = last_replied_user.uid
最佳答案
select * from users u
left outer join topic t on u.id=t.last_replied_by
where t.last_replied_by IS NULL
这将为您提供在主题表的最后回复列中未找到用户 ID 的所有用户。
关于mysql - 如何更改此查询以使用 JOIN?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18093963/