mysql now() Incorrect datetime value for column_MySQL
mysql> select now(); select now() -10;
+---------------------+
| now() |
+---------------------+
| 2009-09-25 21:07:20 |
+---------------------+
1 row in set (0.00 sec)
+-----------------------+
| now() -10 |
+-----------------------+
| 20090925210710.000000 |
+-----------------------+
1 row in set (0.00 sec)
sometime it works, but sometime doesnt for
" mysql now() Incorrect datetime value for column "
There's an insidious problem doing simple maths using now() ... subtraction of seconds and minutes etc are based on 100 seconds in a minute, and 100 minutes in an hour ...
so, you need to be do something more like:
select now(); select now() -INTERVAL 10 SECOND;
and that's how to solver the problem.
bitsCN.com下一篇: 分页的实现(附代码)
推荐阅读
-
使用Mysql5.x以上版本出现报错#1929 Incorrect datetime value: '' for column 'createtime'的快速解决方法
-
解决mysql不能插入中文Incorrect string value
-
使用Mysql5.x以上版本出现报错#1929 Incorrect datetime value: '''' for column ''createtime''
-
MySQL存储表情时报错:java.sql.SQLException: Incorrect string value:‘\xF0\x9F\x92\xA9\x0D
-
使用Mysql5.x以上版本出现报错#1929 Incorrect datetime value: '''' for column ''createtime''
-
MySQL存储表情时报错:java.sql.SQLException: Incorrect string value:‘\xF0\x9F\x92\xA9\x0D
-
mysql存储4字节的表情包数据报异常_Incorrect string value: '\xF0\x9F\x98\x84\xF0\x9F
-
Incorrect datetime value: '' for column 'examDate' at row 1
-
MySQL:1366 - Incorrect string value错误解决办法
-
MySQL存储表情时报错:java.sql.SQLException: Incorrect string value:‘\xF0\x9F\x92\xA9\x0D\x0A...’的解决方法