我有2个名为user和的表userFriend.我希望用户表中的所有用户和userFriend表中的特定成员.然后我想加入他们两个......
user
userID userName
1 aaa
2 bbb
3 ccc
4 ddd
5 eee
userFriend
userFriendID userID friendUserID
1 1 2
2 2 3
3 1 4
4 4 2
Run Code Online (Sandbox Code Playgroud)
所以,如果我的userID = 1,那么我想要结果
userID userName userFriendID friendUserID
2 bbb 1 2
3 ccc NULL NULL
4 ddd 3 4
5 eee NULL NULL
Run Code Online (Sandbox Code Playgroud)
所以这样我想要第二个表的条件,我只想加入第二个表,其中userID = 1,第一个表使用左连接.