请教调用for rec。。loop循环后输出的格式问题,有实例!

czphs czphs 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的程序块如下:
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户】

这个语句要怎么写?
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
czphs
Oracle 17,133 成员 55,258 内容