Re: Is there any way to check for a field with nothing in it?

From: Axel Schwenke <axel.schwenke_at_gmx.de>
Date: Sun, 31 Jul 2016 15:08:00 +0200
Message-ID: <nnkt7h$og3$1_at_dont-email.me>


On 29.07.2016 16:25, bit-naughty_at_hotmail.com wrote:
> If I insert a new line, and put nothing into a particular field,
> what is its value? Is that what NULL is?

If you don't give a value for a field, then the database uses the default value for that field. The default value might be NULL. Or it is a value that has been specified when the table was created. Or it could be the default value for the data type of the field. MySQL gives you many choices here - RTFM!

The concept of NULL is too complex to explain it in a few sentences. Go forward and read a text book on the topic of databases and trinary logic. Or start with Wikipedia.

> How does one check for a NULL field,

SELECT ... WHERE <field> IS NULL

> or ALL NULL fields in a particular line in a table?

SELECT ... WHERE <field1> IS NULL AND <field2> IS NULL AND ...

Normally you aren't allowed to insert a row that has NULL in all fields.

XL Received on Sun Jul 31 2016 - 15:08:00 CEST

Original text of this message