Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

executing null values records

Tags:

sql

null

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

like image 449
jjj Avatar asked Sep 16 '26 13:09

jjj


1 Answers

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

like image 184
James Goodwin Avatar answered Sep 18 '26 05:09

James Goodwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!