SET @tongji_hour = '2012-8-14 0:00:00';
IF DATE_FORMAT(@tongji_hour,'%Y-%m-%d %H:00:00')=DATE_FORMAT(@tongji_hour,'%Y-%m-%d 00:00:00') THEN
SELECT @tongji_hour;
END IF;
报错:[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF DATE_FORMAT(@tongji_hour,'%Y-%m-%d %H:00:00')=DATE_FORMAT(@tongji_hour,'%Y-%m' at line 1
判断是不是整点
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
欢迎选择我的课程,让我们一起见证您的进步~~