oracle 取周

select to_char(to_date('20090108','YYMMDD'),'IW') from dual ;
select to_char(to_date('20090108','YYMMDD'),'WW') from dual ;

select to_char(to_date('20090107','YYMMDD'),'IW') from dual ;
select to_char(to_date('20090107','YYMMDD'),'WW') from dual ;


IW:Week of year (1-52 or 1-53) based on the ISO standard.
WW:Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year.
 参考资料 http://www.techonthenet.com/oracle/functions/to_date.php

posted @ 2009-09-21 08:40  左少白  阅读(313)  评论(0编辑  收藏  举报