在oracle 数据库中查询一个时间段!

2009年的第一天到2009年最后一天,写出sql语句,哥们帮帮忙吧。时间是DATE类型!

假设表Table1中有字段setDate(Date类型)Oracle语法:select * from Table1 where (to_char(setDate,'YYYY-MM-DD') between '2009-01-01' and '2009-12-31')SQLServer语法:select * from Table1 where setDate between '2009-01-01' and '2009-12-31'access语法:select * from Table1 where setDate between #2009-01-01# and #2009-12-31#
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-09-12
select * from Table where to_date>=('2009-01-01' ,'yyyy-mm-dd') and to_date<=('2009-12-31' ,'yyyy-mm-dd')
相似回答