获取当前周的日期段
获取当前周的日期段
1、复制下面的代码到数据库查询即可;
www.zzzyk.com
select ((select (trunc(sysdate,'DD')-to_char(sysdate,'D')+2) from dual)+ rownum - 1) ichdadate from user_objects
where rownum <= ((select (trunc(sysdate,'DD')-to_char(sysdate,'D')+2)+6 from dual)- (select (trunc(sysdate,'DD')-to_char(sysdate,'D')+2) from dual) + 1)
注:
2、其中 select (trunc(sysdate,'DD')-to_char(sysdate,'D')+2) from dual 获取当前周的开始日期;
3、select (trunc(sysdate,'DD')-to_char(sysdate,'D')+2)+6 from dual 获取当前周的结束日期;