SELECT e.hiredate, next_day(trunc(e.hiredate,'mm')-1,2),
next_day(last_day(trunc(e.hiredate,'mm'))-7,2)
FROM EMP E WHERE E.EMPNO =7935 ;
with t as
(select to_date('2013-03-24','yyyy-mm-dd')+(level-1) as dy from dual
connect by level <=10)
select dy,to_char(dy,'day') as days ,next_day(dy,2) as d1 from t
我们可以看到 通过上月末 ( '2013-03-31') 得到哦 “下一个周一” ,通过之前 7天 ( '2013-03-24')得到 “下一个周一”
next_day(last_day(trunc(e.hiredate,'mm'))-7,2)
FROM EMP E WHERE E.EMPNO =7935 ;
with t as
(select to_date('2013-03-24','yyyy-mm-dd')+(level-1) as dy from dual
connect by level <=10)
select dy,to_char(dy,'day') as days ,next_day(dy,2) as d1 from t
我们可以看到 通过上月末 ( '2013-03-31') 得到哦 “下一个周一” ,通过之前 7天 ( '2013-03-24')得到 “下一个周一”
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31369373/viewspace-2127221/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31369373/viewspace-2127221/