数据库 | MySQL | 6. NULL值处理

判断是否为null

SELECT * FROM `runoob_tbl` WHERE `runoob_submission_date` IS NULL;
SELECT * FROM `gm-test`.runoob_tbl WHERE ISNULL(`runoob_submission_date`);
SELECT runoob_id, runoob_title, runoob_author, IFNULL(runoob_submission_date, '空') FROM runoob_tbl;

$ 判断是否为非null

SELECT * from `runoob_tbl` WHERE `runoob_submission_date` IS NOT NULL;

你可能感兴趣的:(数据库 | MySQL | 6. NULL值处理)