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号(周日)不知道为什么会这样? 谢谢
我首先查询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号(周日)不知道为什么会这样? 谢谢
解决方案 »
- 在oracle中求两sql(不重复的记录)
- 查询语句如何选择?
- oracle 版本问题,sql进程查看
- 请教在oracle中如何得到客户提交的事务的信息?
- 2个开发中的小问题!在线!
- oracle sequences的问题.
- 如何导出,导入synonym???
- oracle 数据库里如何实现先查询表B里的记录是否已经在表A中存在,如果存在的就update,不存在的就insert。
- Oracle会把零程度字符串("")当作NULL,怎么办?
- 表空间足够,但是用户却不能够增加数据
- linuxAS4下oracle9i创建数据库点击ok后DBCA界面自动关闭!!
- 用OCI涵数连接ORACL的时候,那个参数决定了可以访问那个SKIM.
不是楼主认为的“周一,周二”那个周