gpt4 book ai didi

Mysql查询问题

转载 作者:行者123 更新时间:2023-11-30 00:13:21 25 4
gpt4 key购买 nike

我有两列,一列是member_id,另一列是connection_member_id。我必须检查member和connection_member是否已经插入到数据库中,然后不要插入它。

尝试获取类似的东西

SELECT * FROM `mlm_connections` mc 
LEFT JOIN temp_connections_members tcm
ON tcm.member_id != mc.member_id
AND tcm.connection_member_id != mc.connection_member_id;

最佳答案

试试这个

SELECT * FROM `mlm_connections` mc 
WHERE mc.member_id NOT Exists (SELECT member_id FROM temp_connections_members) AND
mc.connection_member_id NOT Exists (SELECT connection_member_id FROM temp_connections_members)

关于Mysql查询问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23868218/

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