gpt4 book ai didi

mysql - 需要对两个表编写查询

转载 作者:行者123 更新时间:2023-11-29 14:06:49 24 4
gpt4 key购买 nike

我有两张 table

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)

关于mysql - 需要对两个表编写查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14210630/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com