colap Posted August 18, 2015 Share Posted August 18, 2015 What is the difference between IS NULL and =NULL? SELECT * FROM user,course WHERE user.course is NULL; SELECT * FROM user,course WHERE user.course=NULL; Tables information is here: http://www.sitepoint.com/understanding-sql-joins-mysql-database/ Quote Link to comment https://forums.phpfreaks.com/topic/297841-what-is-the-difference-between-is-null-and-null/ Share on other sites More sharing options...
requinix Posted August 18, 2015 Share Posted August 18, 2015 (edited) IS NULL is how you check whether a value is actually NULL or not. You will get true/1 or false/0. = NULL is normal comparison, except when you compare something with NULL you will simply get NULL as the result. Try it: SELECT 1 IS NULL; SELECT 0 IS NULL; SELECT NULL IS NULL; SELECT 1 = NULL; SELECT 0 = NULL; SELECT NULL = NULL; Edited August 18, 2015 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/297841-what-is-the-difference-between-is-null-and-null/#findComment-1519139 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.