1

我有以下查询:

select * from player_source 
where source is not null

这导致

ID      create_dtime
001     2012-10-16 16:13:27
002     2012-12-10 16:13:27

等等...

我想过滤查询,使其仅返回 create_dtime 大于或等于 2012 年 12 月 3 日且小于或等于 2012 年 12 月 9 日的结果。

我尝试使用

select * from player_source 
where source is not null
and Create_Dtime >= To_Date('2012-Dec-03','yyyy-mon-dd')
and Create_Dtime <= To_Date('2012-Dec-09','yyyy-mon-dd')

使用我的 Oracle 根,但它似乎没有用。有什么想法吗?

4

3 回答 3

2

询问:

select * 
from player_source 
where source is not null
and Create_Dtime >= '2012-10-03'
and Create_Dtime <= '2012-10-09'
于 2012-12-11T21:09:50.557 回答
0

尝试这个

 select * 
 from player_source 
 where source is not null
 and Create_Dtime >= '2012-Dec-03'
 and Create_Dtime <= '2012-Dec-09'
于 2012-12-11T21:10:29.203 回答
0

语法是:

select * from player_source 
where source is not null
and Create_Dtime > '2012-12-03'
and Create_Dtime <= '2012-12-09'

或者,更简洁地说:

select * from player_source 
where source is not null
and Create_Dtime > '2012-12-03' BETWEEN
and '2012-12-09'
于 2012-12-11T21:10:38.940 回答