CodesJava

Easy learning with example program codes

IS NOT NULL in MySQL

MySQL IS NOT NULL
To filter the results, MySQL IS NOT NULL condition is used with SELECT, INSERT, UPDATE and DELETE statements to check for NOT NULL values.

Syntax:

WHERE expression IS NOT NULL; 

Parameters:
expression: It is used to specify a column or a field to be tested.

Example:
Students table:

ID	NAME	AGE
1	Joy	5
2	Smiley	13
3	Happy	11
4	Tom	15
5	Jerry	10
6	Bruno	
7	David	

Query:

SELECT name
FROM students  
WHERE  age IS NOT NULL;

Output:

NAME
Joy
Smiley
Happy
Tom
Jerry
5 rows  in set <0.12 sec>
Please follow and like us:
error









Copyright © 2019 CodesJava DMCA.com Protection Status