Running records with null values

I am trying to execute records having TotalTime nullvalue from table NewTimeAttendance... TotalTimedatatypenchar(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 see that there are some values null TotalTime.. !!

This is a small sample. Why doesn’t it work? is there any way (special way) to execute "NULL" with type nchar?!

early

+3
source share
1 answer

You need to use IS NULL

select * from newtimeattendance where TotalTime IS NULL

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

+5
source

Source: https://habr.com/ru/post/1737102/


All Articles