Programming: SQL: Programming Guide: Javascript and Coding: LEARN IN A DAY! (SQL, Wed Design, Java, Computer Programming, HTML, SQL, CSS) by Swift Os

Programming: SQL: Programming Guide: Javascript and Coding: LEARN IN A DAY! (SQL, Wed Design, Java, Computer Programming, HTML, SQL, CSS) by Swift Os
Author: Swift, Os [Swift, Os]
Language: eng
Format: epub
Publisher: Unknown
Published: 2015-05-07

Mahran

20

Mahnaz

NULL

Jen

NULL

Gill

20

4 rows in set (0.00 sec)

mysql>

You can see that = and!=do not work with NULL values as follows:

mysql> SELECT * FROM tcount_tbl WHERE tutorial_count = NULL;

Empty set (0.00 sec)

mysql> SELECT * FROM tcount_tbl WHERE tutorial_count != NULL;

Empty set (0.01 sec)

The queries should be written in this manner if you wish to find the records for which the tutorial_count is NULL or not.

mysql> SELECT * FROM tcount_tbl

-> WHERE tutorial_count IS NULL;

tutorial_author

tutorial_count