Problems using mysql “=null”

select last_name , job_id from employees where manager_id is null ; select last_name , job_id from employees where manager_id <=> Null ; select last_name , job_id from employees where manager_id = Null ;

last = null is wrong

If one of the values, strings, or expressions on either side of the equal sign is NULL, the result of the comparison is NULL.

So use <=>…

The post Problems using mysql “=null” first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9659
This site is for inclusion only, and the copyright belongs to the original author.