日期:2014-05-16 浏览次数:20900 次
with temp as( select '0011' name,to_date('2011-01-17','yyyy-mm-dd') "date",'ss' mark from dual union all select '0011' name,to_date('2011-1-24','yyyy-mm-dd') "date",'sss' mark from dual union all select '0022' name,to_date('2011-1-31','yyyy-mm-dd') "date",'ddd' mark from dual ),x as( select level lv from dual connect by level < 100 ) select name,date1,dates from( select name,"date" + lv -1 date1,to_char("date" + lv-1,'DAY') dates from temp,x order by name )where trim(dates)='MONDAY' and name='0022' and date1 >=to_date('2011-01-01','yyyy-mm-dd') and date1 <=to_date('2011-02-07','yyyy-mm-dd') order by name,dates