0
編寫查詢我有兩個表需要在兩個表
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)