簡體   English   中英

從tbl1中未列出的tbl1中選擇

[英]Select From tbl1 not listed in tbl2

我需要進行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;

您需要在最后將= NULL更改為IS NULL 那是正確的語法。 請參見使用NULL

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM