MySQL IS NULL Condition

MySQL IS NULL condition is used to check if there is a NULL value in the expression. It is used with SELECT, INSERT, UPDATE and DELETE statement.

Syntax:

snippet
expression IS NULL

Parameter

expression: It specifies a value to test if it is NULL value.

Consider a table "officers" having the following data.

MySQL IS NULL Condition 1

Execute the following query:

snippet
SELECT *
FROM officers
WHERE officer_name IS NULL;

Output:

MySQL IS NULL Condition 2

Note: Here, you are getting the empty result because there is no NULL value in officer_name column.

Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +