mysql datetime查询异常 异常:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp (2011-05-25 11:38:40) 描述:非空无默认值的Datetime类型字段,查询时程序报以下错误: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 解决方法:数据库连接串添加zeroDateTime
在项目里面,使用mysql datetime desc,看见别人使用UNIX_TIMESTAMP(datetime) desc,就用了 datetime进行比较,使用UNIX_TIMESTAMP()进行转换之后进行比较,心里放心,因为是UNIX 时间戳之间对比大小嘛 SELECT * FROM `table` WHERE UNIX_TIMESTAMP(create_on) <= UNIX_TIMESTAMP('2016-01-26 23:59:59') ORDER BY UNIX_TIMESTA