Code:
with tmp (auf, fert, teil) as ( values
('AN160007548', '4711', 'TEIL1202480550'),
('AN160010602', '4712', 'TEIL1202480550'),
('AN160011460', '4713', 'TEIL1202480550'),
('AN160011863', '4714', 'TEIL1202480550'),
('AN160012865', '4715', 'TEIL1202480550'),
('AN160001605', '4716', 'TEIL1202480557'),
('AN160008730', '4717', 'TEIL1202480557'),
('AN160009457', '4718', 'TEIL1202480557'),
('AN160009383', '4719', 'TEIL1202560550'),
('AN160009468', '4720', 'TEIL1202560550'),
('AN160010881', '4721', 'TEIL1202560550'),
('AN160011506', '4722', 'TEIL1202560550'),
('AA160000195', '4723', 'TEIL1202460129'),
('AA160000195', '4724', 'TEIL1202470129'),
('AA160000310', '4725', 'TEIL1202460129'),
('AA160000310', '4726', 'TEIL1202470129'),
('AN160008509', '4727', 'TEIL1202490550'),
('AN160011380', '4728', 'TEIL1202490550'),
('AN160011731', '4729', 'TEIL1202490550') )
, data as (select distinct auf, teil from tmp order by 1, 2)
, t1 (auf, teil, teile ) as (select auf, teil, ' ' from data
union all select t2.auf, t2.teil, t2.teil concat ',' concat t1.teile from t1, data as t2
where t1.auf=t2.auf and t2.teil>substr(t1.teile, 1, 14))
, help as (select auf, max(teile) teile from t1 group by auf order by auf)
select teile, count(*), min(auf), max(auf) from help group by teile order by 2 desc
(habe die Daten hier etwas gekürzt)
Bookmarks