我有两张桌子
Member (member_id,...)
friend-requests(member_id, friend_id)
我需要从 member_id 为 19 且不在列friend_id 中的成员表中获取所有记录
我有两张桌子
Member (member_id,...)
friend-requests(member_id, friend_id)
我需要从 member_id 为 19 且不在列friend_id 中的成员表中获取所有记录
select * from member join friend-requests
on member.member_id=friend_requests.member_id
where
member.member_id=19
and
not exists (select f.member_id from friend-requests f where f.mmeber_id = member.member_id)
Select m.* from Member as m
where member_id=19 and
member_id not in (select friend_id from friend_requests where member_id=19)