我有一个表,有个字段是dates,char,(18)位,存放的是日期如:'2007-01-0112:00:00',没有空的
发现作select count(*) from tablename where dates>'2007-12-3111:00:00'数据是有的
但用select count(*) from tablename where dates>'2007-01-0101:00:00'结果是0,
用 select count(*) from tablename where dates>'2007-12-0101:00:00'结果是有的,
如果我用select count(*) from tablename where substr(dates,1,18)>'2007-01-0101:00:00'结果也是有的,
这个字段是有索引的.
就是大于2007-01-01到2007-11-31之间的都是0,
有谁遇到过这种现象?
是由于什么问题造成的?会不会是索引造成的?
我觉得奇怪 的为什么以下两句做的结果不一样?
select count(*) from tablename where dates>'2007-01-0101:00:00'结果是0,
select count(*) from tablename where substr(dates,1,18)>'2007-01-0101:00:00'结果是有的