程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SqlServer數據庫 >> 關於SqlServer >> SQL語句查詢是否為空 =null及null

SQL語句查詢是否為空 =null及null

編輯:關於SqlServer

a                  b                             c             d

980515      精頂企業有限公司         簡家豪      NULL

980514      全欣木業有限公司         NULL       123

980514      迅億科技股份有限公司   簡逢浚      NULL

980515      聖越國際企業有限公司   NULL       111 

表結構如上所示,要查詢C列為空的記錄的SQL語句不是select * from table where c=null; 或者 select * from table where c=''; 而應當是 select * from table where c is null; 相反地要查詢不為空的則應當是 select * from talbe where c<>''; 或者 select * from table where c is not null; 注意:不是not is null哦。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved