gpt4 book ai didi

mysql - 在mysql中获取未连接的值

转载 作者:行者123 更新时间:2023-11-29 05:23:54 28 4
gpt4 key购买 nike

我在Mysql中有2个表

表 1 --

ID candidate_id 简历

25 100 hjksdf.jpg

26 101 hdd.docx

29 102 hf.docx

30 103 hsdfh.docx

表 2 --

resumes_sent_id client_id candidate_id 日期

1 43 100 2014-03-14 03

2 43 101 2014-03-15 03

我需要加入这两个表,加入后 client_id 43 我只需要“未加入”的记录。如果我加入,我可以获得 candidate_id 值具有唯一的 100,101。但是在我的输出中,我需要那些具有 102,103 的数据记录,这意味着除了加入的唯一值。

基于 t2,其中 client_id 为 43,有两个值 100 和 101,但我想过滤不匹配的值,例如 102。

最佳答案

试试这个

SELECT table1.*
FROM table1 LEFT JOIN table2 ON table2.candidate_id=table1.candidate_id
WHERE table2.candidate_id IS NULL and t2.client_id=43

关于mysql - 在mysql中获取未连接的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22472811/

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