SQL is null clause, is not null clause option can filter records from database table name on null value in rows. This returns only null rows which we put is null clause in query, and returns those rows which not having null in row on is not null clause. null keyword can be used on one column name and more than one column name in SQL query. null clause can be implemented in MySQL, oracle, db2, Microsoft SQL server.
SQL null query example explains how to use null query in SQL.
Table class_name with all records without desired column name sorting
+---------+-------------+------------+------------+ | Roll_No | Name | Class_Name | Year_Start | +---------+-------------+------------+------------+ | 1 | Amit Mishra | B.Science | 2005 | | 2 | Robot | B.Tech | 2005 | | 3 | Rohan | M.Tech | 2005 | | 4 | Vivek | B.Tech | 2009 | | 5 | Chander | B.Science | 2009 | | 6 | Deepak | B.Science | 2009 | | 7 | Gagan Deep | B.Tech | NULL | | 8 | Mohit Garg | M.Tech | NULL | +---------+-------------+------------+------------+
Where clause
SELECT * FROM class_name where Year_Start is null;
Output
+---------+------------+------------+------------+ | Roll_No | Name | Class_Name | Year_Start | +---------+------------+------------+------------+ | 7 | Gagan Deep | B.Tech | NULL | | 8 | Mohit Garg | M.Tech | NULL | +---------+------------+------------+------------+
this SQL query returns those row which column name (Year_Start) having null value only from table.
SELECT * FROM class_name where Year_Start is not null;
Output
+---------+-------------+------------+------------+ | Roll_No | Name | Class_Name | Year_Start | +---------+-------------+------------+------------+ | 1 | Amit Mishra | B.Science | 2005 | | 2 | Robot | B.Tech | 2005 | | 3 | Rohan | M.Tech | 2005 | | 4 | Vivek | B.Tech | 2009 | | 5 | Chander | B.Science | 2009 | | 6 | Deepak | B.Science | 2009 | +---------+-------------+------------+------------+
this SQL query returns those row which column name (Year_Start) not having null value only from table.
* indicates fetch all columns records from table.



Link to Us
I wrote the same code as you wrote on your article but on my local computer does not work with is null and is not null syntax.
Do you think it because of sql version or the other problems?
sql version is 5.1.36
I hope to hear from you soon.