oracle9.2數據庫
我首先查询07年1月份14~16号
SELECT  'W'||TO_CHAR(transdate,'ww')as weeks,transdate
from wltx
where VERB='FILT'
and transdate>to_timestamp('2007/01/14 07:00:00.000000','yyyy/mm/dd hh24:mi:ss.ff6')
and transdate<=to_timestamp('2007/01/16 07:00:00.000000','yyyy/mm/dd hh24:mi:ss.ff6')
order by transdate捞取的值为:
135 W02 14-1月 -07 07.58.26.000000 上午
136 W02 14-1月 -07 08.11.55.000000 上午
137 W02 14-1月 -07 08.15.07.000000 上午
138 W02 14-1月 -07 08.15.17.000000 上午
139 W02 14-1月 -07 08.16.03.000000 上午
140 W03 15-1月 -07 07.56.00.000000 上午   *********
141 W03 15-1月 -07 08.07.08.000000 上午
142 W03 15-1月 -07 08.07.10.000000 上午
143 W03 15-1月 -07 08.07.10.000000 上午
144 W03 15-1月 -07 08.07.12.000000 上午
145 W03 15-1月 -07 08.10.15.000000 上午我再查询06年12月份09~11号
SELECT  'W'||TO_CHAR(transdate,'ww')as weeks,transdate
from wltx
where VERB='FILT'
and transdate>to_timestamp('2006/12/09 07:00:00.000000','yyyy/mm/dd hh24:mi:ss.ff6')
and transdate<=to_timestamp('2006/12/11 07:00:00.000000','yyyy/mm/dd hh24:mi:ss.ff6')
order by transdate捞取的值为:2576 W49 09-12月-06 11.55.22.000000 下午
2577 W49 09-12月-06 11.55.34.000000 下午
2578 W49 09-12月-06 11.55.58.000000 下午
2579 W49 09-12月-06 11.56.26.000000 下午
2580 W50 10-12月-06 12.17.49.000000 上午  *****************
2581 W50 10-12月-06 12.18.18.000000 上午
2582 W50 10-12月-06 01.08.10.000000 上午
2583 W50 10-12月-06 01.08.58.000000 上午
2584 W50 10-12月-06 01.09.13.000000 上午问题:
07年分周是以01/15号(周一)06年分周是以12/15号(周日)不知道为什么会这样?  谢谢