简体   繁体   English

从tbl1中未列出的tbl1中选择

[英]Select From tbl1 not listed in tbl2

I need to make MySQL query to select records from TBL1 not listed in TBL2 , but not working with my query. 我需要进行MySQL查询,以从TBL2未列出的TBL1选择记录,但不能与我的查询一起使用。

SELECT deleted_guids.guid_type
     , HEX(data_table.guid_id) as guid_id
     , HEX(data_table.guid_type) as guid_type
FROM data_table 
LEFT JOIN deleted_guids 
     ON     data_table.guid_id = deleted_guids.guid_id 
        AND data_table.guid_type = deleted_guids.guid_type 
WHERE deleted_guids.guid_type = NULL;

You need to change = NULL to IS NULL at the end; 您需要在最后将= NULL更改为IS NULL that's the correct syntax. 那是正确的语法。 See working with NULL values . 请参见使用NULL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM