2017-11-11 75 views

回答

0

給這一個鏡頭:

Select users.* 
from users 
where users.id not in (
    select followers.follower_id 
    from followers 
    where followers.user_id = "2" 
) 
+0

謝謝,完美工作! –

+0

請接受這個答案作爲正確的答案。謝謝。 – RLessard

0

我不是一個mysql專家,但我相信一個僞sql將是:

select users.* from users where users.id is in (select distinct follower_id from followers where followers.user_id != 2) 

!=意味着不同

+0

結果返回多個用戶重複 https://image.prntscr.com/image/T-iRabAaQg_9Jzshg02luQ.png –

+0

我已經改變了僞sql。 – srodriguex

+0

您可以使用** distinct **刪除重複項。 – srodriguex

相關問題