oracle 不等於的問題<> !=

簡單的查詢

SELECT * FROM sap_zcsp WHERE 欄位<>'X'

顯示不出為null的數據,必須帶上 IS null

查詢后得知:null 只能通過IS null 或者IS not null,其他的操作符跟null操作都是false

SELECT * FROM sap_zcsp WHERE 欄位!='X'or 欄位is null

或者可以表示成

SELECT * FROM sap_zcsp WHERE nvl(欄位名,‘xx’)<>'X' 

--select * from sap_zcsp where instr(concat(欄位名,'xx'),'X') = 0

原文地址:https://www.cnblogs.com/sharon0203/p/10774041.html