日期:2014-05-17 浏览次数:20718 次
with test as( select 50 amt, to_date('09-03-2011','dd-mm-yyyy') dat from dual union all select 40 amt, to_date('06-03-2011','dd-mm-yyyy') dat from dual union all select 30 amt, to_date('09-05-2011','dd-mm-yyyy') dat from dual union all select 20 amt, to_date('09-04-2011','dd-mm-yyyy') dat from dual union all select 10 amt, to_date('09-07-2011','dd-mm-yyyy') dat from dual union all select 60 amt, to_date('09-08-2011','dd-mm-yyyy') dat from dual union all select 80 amt, to_date('09-11-2011','dd-mm-yyyy') dat from dual union all select 70 amt, to_date('09-12-2011','dd-mm-yyyy') dat from dual union all select 55 amt, to_date('09-02-2012','dd-mm-yyyy') dat from dual ) select amt, to_char(dat,'q') quater,to_char(dat,'yyyy') year from test