日期:2014-05-20  浏览次数:20533 次

一个和数据库相关的小问题!
如果我想得到数据库中2007-04-05到2007-04-10之间的数据用什么方法呀,   

我怎么才能得到?
高手帮忙呀~~~急!!

------解决方案--------------------
X > 2007-04-05 AND X < 2007-04-10
------解决方案--------------------
select * from table_name where date> 2007-04-05 and date <2007-04-10;
------解决方案--------------------
学习
------解决方案--------------------
select * from table_name where date> =2007-04-05 and date <=2007-04-10;

------解决方案--------------------
你用的什么数据库啊?oracle这样写:
select * from T1 where DATE between to_Date( '2007-04-05 ', 'yyyy-mm-dd ') and to_Date( '2007-04-10 ', 'yyyy-mm-dd ');
------解决方案--------------------
还有你的这个字段当初定义的是什么类型的?
varchar的话就是楼上的
------解决方案--------------------
select * from table_name where between to_Date( '2007-04-05 ', 'yyyy-mm-dd ') and to_Date( '2007-04-10 ', 'yyyy-mm-dd ');