Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 35.1Mb
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

9.1.7 NULL Values

TheNULL value meansno data.NULL can be written in any lettercase. A synonym is\N (case-sensitive). Treatment of\N as a synonym forNULL in SQL statements is deprecated as of MySQL 5.7.18 and is removed in MySQL 8.0; useNULL instead.

Be aware that theNULL value is different from values such as0 for numeric types or the empty string for string types. For more information, seeSection B.3.4.3, “Problems with NULL Values”.

For text file import or export operations performed withLOAD DATA orSELECT ... INTO OUTFILE,NULL is represented by the\N sequence. SeeSection 13.2.6, “LOAD DATA Statement”. Use of\N in text files is unaffected by the deprecation of\N in SQL statements.

For sorting withORDER BY,NULL values sort before other values for ascending sorts, after other values for descending sorts.