Last Updated: 25 June, 2023
In MySQL, the IS NOT NULL condition is used to check if a column or expression has a non-null value. It is typically used in the WHERE clause of a query to filter out rows that have null values in a specific column.
Here's an syntax of how to use "IS NOT NULL" in a MySQL query:
SELECT column_name1, column_name2 FROM table_name WHERE column_name IS NOT NULL;
In the above syntax, replace "column_name1" and "column_name2" with the actual column names we want to retrieve from the table, and "table_name" with the name of our table.
The WHERE clause filters the rows and only returns those where the specified column is not null. This means that any rows where the column contains a non-null value will be included in the result set.
Let's see the example of how to use "IS NOT NULL" in a MySQL query:
SELECT emp_name, emp_designation FROM employee WHERE bonus IS NOT NULL;
Remember that the "IS NOT NULL" condition can be used with any column that allows null values. It is useful for filtering records based on the presence of a value in a specific column.
That's all, guys. I hope this MySQL article is helpful for you.
Happy Learning... 😀
feedback@javabytechie.com