/*NULL=======================================*/ SELECT IFNULL(NULL,'IS NULL'); #IS NULL /*date type==================================*/ SELECT DATE_FORMAT(NOW(),'%Y-%m-%d %H:%i:%s'); #2021-04-02 10:13:52 SELECT STR_TO_DATE('2021-04-02','%Y-%m-%d'); #2021-04-02 SELECT UNIX_TIMESTAMP(NOW()); #1617329776 SELECT UNIX_TIMESTAMP('2021-04-02'); #1617292800 SELECT FROM_UNIXTIME(1617329776); #2021-04-02 10:16:16 SELECT FROM_UNIXTIME(1617329776,'%Y-%m-%d %H:%i:%s'); #2021-04-02 10:16:16 SELECT DATE_ADD('2021-04-02',INTERVAL 1 day); #2021-04-03 SELECT DATE_ADD(NOW(),INTERVAL 1 day); #2021-04-03 10:17:57 SELECT DATEDIFF(NOW(),'2021-03-01'); #32 SELECT DATEDIFF('2021-04-02','2021-04-01'); #1 /*char type==================================*/ SELECT CONCAT('hello','-',123); #hello-123