table person:
name
type enum('admin','user','random') NULL DEFAULT NULL
When this query is performed, it doesnt return the records that have a type of NULL
select * from person where type != 'admin';
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
null cannot be tested for with (in)equality statements. you need to use
IS NULL. e.g.e.g. null is “contagious”
etc… it’s basically “unknown”. Mixing known and unknown in sql makes the result unknown, always. Hence the special ifnull(), coalesce(), and “if null” tests/functions.