簡體   English   中英

如何更改此查詢以使用JOIN?

[英]How do I change this query to use a JOIN?

我目前有

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的用戶。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM