executing null values records

偶尔善良 提交于 2019-12-12 12:46:23

问题


i am trying to execute the records that have TotalTime null value from the table NewTimeAttendance...TotalTime datatype nchar(10)

select * from newtimeattendance where TotalTime =  'NULL'

....nothing

select * from newtimeattendance where TotalTime =  'null'

....nothing

select * from newtimeattendance where TotalTime =  'Null'

....nothing

select * from newtimeattendance where TotalTime =  null

....nothing

select * from newtimeattendance where TotalTime =  Null

....nothing

select * from newtimeattendance where TotalTime =  NULL

....nothing

when i select the whole table i can see that there is some NULL TotalTime values..!!

it is small select statment ..why doesn't it work ? is there a way (special way ) to execute the 'NULL' with nchar type ?!

thanks in advance


回答1:


You need to use IS NULL

select * from newtimeattendance where TotalTime IS NULL

The MySQL doc has some good information on dealing with NULL values: http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html



来源:https://stackoverflow.com/questions/2452783/executing-null-values-records

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!