Great! Remember, NULL is a special value. You can't use the equals sign to check whether something is NULL. It simply won't work. The opposite of IS NOT NULL is IS NULL.
SELECT id FROM user WHERE middle_name IS NULL;
This query will return only those users who don't have a middle name, i.e. their middle_name is unknown.
Syntax:
SELECT * FROM table-name WHERE column_name IS NULL;
Exercise
Select all cars whose price column is a NULL value.
Execute below code
SELECT * FROM car WHERE price IS NULL;
VIN
|
BRAND
|
MODEL
|
PRICE
|
PRODUCTION_YEAR
|
GS723HDSAK2399002
|
Opel
|
Corsa
|
null
|
2007
|
No comments:
Post a Comment