请教调用for rec。。loop循环后输出的格式问题,有实例!
czphs 2012-03-15 11:51:28 我的程序块如下:
for rec in ( select a2.area,a1.sp,a1.hj
from
(SELECT a.org_id,b.prod_catalog sp, count(distinct a.billing_no) hj
from cyj_zgq_day_report_ls a, YZ_OFFER_FLAG b
where a.region_id = 73508
and a.prod_offer_id = b.prod_offer_id
and a.service_offer_id = '80000045'
and to_char(a.complete_date, 'yyyymmdd') = cTj_Day
group by a.org_id,b.prod_catalog) a1,
ar_area a2
where a1.org_id=a2.org_id
)loop
cRegion := cRegion||rec.area||'【'||rec.sp||':'||rec.hj||'户'||'】';
这样结果就是:安仁【450D签转:1户】安仁【E9:2户】安仁【【450D签转:1户】】
我要得到的结果:安仁 【450D签转:1户;450D签转:1户,E9:2户】
这个语句要怎么写?