select t.mail_no,wm_concat(t.notice_no) as notice_no_all from ardba.arbino t group by t.mail_no
select a.mail_no,wm_concat(a.notice_no) || max(a.str) as notice_no_all from
(select k.mail_no,k.notice_no,
case when k.all_sum > 4000 then '...' else null end as str from
(select t.mail_no, t.notice_no,
sum(vsize(t.notice_no || ',')) over(partition by t.mail_no) as all_sum,
sum(vsize(t.notice_no || ',')) over(partition by t.mail_no order by t.notice_no) as up_sum
from ardba.arbino t) k
where (k.up_sum <= 3998 and k.all_sum > 4000)
or k.all_sum <= 4001) a
group by a.mail_no