语法写出来
看看
select (case when t.fund_code is null then ' '
else t.recevied_date end) recevied_date,
(case when t.fund_code is null and t.recevied_date is null then '总计'
when t.fund_code is null then '合计'
else min(tt.fund_name)||to_char(to_date(min(t.trade_date),'yyyymmdd'),'yyyy-mm-dd')||'日交易' end) last_date,
sum(decode(t.operation_flag,'1',t.recevied_money)),
sum(decode(t.operation_flag,'1',0,t.recevied_money)),
sum(decode(t.operation_flag,'1',t.recevied_money))-sum(decode(t.operation_flag,'1',0,t.recevied_money)),
(case when t.fund_code is null then '1' else '0' end) BOLD
from fundrecevied_book t,
(select t0.fund_code fund_code,
t1.fund_name fund_name
from par_fund_team t0,par_fund t1
where t0.big_fund_code='PX_fundcode'
and t1.fund_code=t0.fund_code
and substr(t1.fund_kind,1,1)='2') tt
where t.fund_code=tt.fund_code
and t.recevied_date between 'PX_startdate' AND 'PX_enddate'
and t.operation_flag in ('1','2')
group by rollup(t.recevied_date,t.fund_code)