执行空值记录

时间:2010-03-16 07:51:30

标签: sql null

我正在尝试执行表TotalTimenull NewTimeAttendance值的记录... TotalTime数据类型nchar(10)

select * from newtimeattendance where TotalTime =  'NULL'

...无

select * from newtimeattendance where TotalTime =  'null'

...无

select * from newtimeattendance where TotalTime =  'Null'

...无

select * from newtimeattendance where TotalTime =  null

...无

select * from newtimeattendance where TotalTime =  Null

...无

select * from newtimeattendance where TotalTime =  NULL

...无

当我选择整个表格时,我可以看到有一些NULL TotalTime值.. !!

这是小选择的声明..为什么不起作用?有没有办法(特殊方式)用nchar类型执行'NULL'?

提前致谢

1 个答案:

答案 0 :(得分:5)

您需要使用IS NULL

select * from newtimeattendance where TotalTime IS NULL

MySQL doc有一些关于处理NULL值的好信息: http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html

相关问题