SELECT to_char(ADate,'yyyy')||'年'||to_char(ADate,'q')||'季度' as 季度,sum(AValue) as total from tablename
group by to_char(ADate,'yyyy')||'年'||to_char(ADate,'q')||'季度'
SELECT to_char(ADate,'yyyy')||'年'||to_char(ADate,'iw')||'周' as 周,sum(AValue) as total from tablename
group by to_char(ADate,'yyyy')||'年'||to_char(ADate,'iw')||'周'
SELECT to_char(ADate,'yyyy')||'年'||to_char(ADate,'mm')||'月'
|| case when to_char(ADate,'dd')<=10 then '上旬' when to_char(ADate,'dd')>20 then '下旬' else '中旬' end
as 旬,sum(AValue) as total from tablename
group by to_char(ADate,'yyyy')||'年'||to_char(ADate,'mm')||'月'
|| case when to_char(ADate,'dd')<=10 then '上旬' when to_char(ADate,'dd')>20 then '下旬' else '中旬' end