17,089
社区成员
发帖
与我相关
我的任务
分享
select *
from table t
where to_char(t.insert_time, 'mm') = 8
and to_char(t.insert_time, 'w') = 2;
with t1 as
(
select date'2013-08-02' c1 from dual union all
select date'2013-08-05' c1 from dual union all
select date'2013-08-08' c1 from dual union all
select date'2013-08-11' c1 from dual union all
select date'2013-08-22' c1 from dual union all
select date'2013-08-26' c1 from dual
)
select *
from t1
where to_char(c1,'w')=2
and c1 >= to_date('2013-08','yyyy-mm')
and c1 < add_months(to_date('2013-08','yyyy-mm'),1)
c1
-----------------------
1 2013/8/8
2 2013/8/11