我从4.0升级到5.1,发现以前写的语句:
select * from user where create_time>='20100101 18:37:17' 返回结果不对了,这种时间格式5.0不认,
可这么写的页面非常多,改不过来,能修改mysql5.0的配置识别这种语句吗?
select * from user where create_time>='20100101 18:37:17' 返回结果不对了,这种时间格式5.0不认,
可这么写的页面非常多,改不过来,能修改mysql5.0的配置识别这种语句吗?
date_format(create_time,'%Y-%m-%d hh:mm:ss')
数据库已经升级到5.1,日期也都是按照标准格式2010-01-01 18:37:17存储的。
现在的问题是4.0可以做select * from user where create_time>='20100101 18:37:17'这样的查询,
但是5.1不可以了!怎么样可以让5.1也接受这样的查询呢?
问题是我页面查询语句是: create_time>='20100101 18:37:17'
现在我不改页面,数据库可不可以识别这种输入格式?
2.可以改SQL语句的话,试试“select * from ocgrp where date_format(upldatetime,'%Y%m%d hh:mm:ss')>='20090101 18:37:17' ”