In MySQL, we can select rows where a column is null by using IS NULL operator.
We have a table "employee" as below:
employee
id first_name salary country
.......................................................
1 John 10000 Canada
2 Chris 20000 NULL
3 Max 30000 NULL
4 Jenny 25000 Canada
Use the IS NULL operator
The below statement selects all employee where "country" is null:
SELECT * FROM employee
WHERE country is null;
Result
id first_name salary country
.......................................................
2 Chris 20000 NULL
3 Max 30000 NULL
Hope this will help you :)
0 Comment(s)