SQL Server中,null 與not null 在什么時候用?
2 回答

慕田峪9158850
TA貢獻1794條經驗 獲得超7個贊
1.在定義表時
create table t1
(
id int not null , --默認為可以為空
.......
)
2.在篩選字段時,比如你定義郵箱驗證表時把沒有驗證郵箱的用戶Email_In的值為空,你要查詢沒有驗證郵箱的用戶。要用到的 is null
select * from table where Email_In is null 反之(is not null)為驗證過的用戶。
- 2 回答
- 0 關注
- 806 瀏覽
添加回答
舉報
0/150
提交
取消