select to_char(t.d,'YY-MM-DD') from (
select trunc(sysdate, 'MM')+rownum-1 as d
from dba_objects
where rownum < 32) t
where to_char(t.d, 'MM') = to_char(sysdate, 'MM') --找出当前月份的周五的日期
and trim(to_char(t.d, 'Day')) = '星期五'
--------
11-05-02
11-05-09
11-05-16
11-05-23
11-05-30
select trunc(sysdate, 'MM')+rownum-1 as d
from dba_objects
where rownum < 32) t
where to_char(t.d, 'MM') = to_char(sysdate, 'MM') --找出当前月份的周五的日期
and trim(to_char(t.d, 'Day')) = '星期五'
--------
11-05-02
11-05-09
11-05-16
11-05-23
11-05-30
如果把where to_char(t.d, 'MM') = to_char(sysdate, 'MM')改成sysdate-90,即为查找当前 月份的前三个月中的每周五的日期。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/252936/viewspace-711505/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/252936/viewspace-711505/