oracle中創(chuàng)建視圖并查詢視圖 查詢一個(gè)字段不為空的數(shù)據(jù),怎么查?
查詢一個(gè)字段不為空的數(shù)據(jù),怎么查?例如,insert into table a(A1,B1)values(“A1”,”)在這種情況下,由于表中包含“”,實(shí)際上它沒有內(nèi)容。若要查詢此字段,不能直接使用s
查詢一個(gè)字段不為空的數(shù)據(jù),怎么查?
例如,
insert into table a(A1,B1)values(“A1”,”)
在這種情況下,由于表中包含“”,實(shí)際上它沒有內(nèi)容。若要查詢此字段,不能直接使用
select*
from a
where B1=“”
來判斷它是否為空,不能使用等號(hào),因?yàn)閚ull在SQL中被視為特殊符號(hào),必須使用關(guān)鍵字Is和not
應(yīng)該這樣使用:
select*from a where B1 Is null
或:
select*from a where B1 Is not null