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

posted on 2019-04-26 14:18  Sharon0203  阅读(124)  评论(0编辑  收藏  举报

导航