with data as (
SELECT tmp1.serie,
tmp1.id_training,
sum(tmp1.ergebnis_zehntel) AS sum_zehntel
FROM (
select (row_number() OVER (PARTITION BY t.id_training, t.id_schuss_typ ORDER BY t.id_shot) - 1) / 10 + 1 AS serie,
t.id_shot,
t.ergebnis_zehntel,
t.id_training,
t.id_schuss_typ,
t.id_schuetze,
s.schuetzen_name
FROM t_transfer_rci_shot_h t
JOIN t_schuetzen s ON t.id_schuetze = s.id_schuetzen
WHERE t.id_training >= 11018
and s.schuetzen_name like 'Sim%'
and t.id_schuss_typ = 2
) tmp1
GROUP BY tmp1.serie, tmp1.id_training, tmp1.id_schuss_typ
)
select s1.sum_zehntel as summe_1, s2.sum_zehntel as summe_2, s3.sum_zehntel as summe_3
,s1.sum_zehntel + s2.sum_zehntel + s3.sum_zehntel as summe_total
from data as s1
join data as s2 on s1.id_training = s2.id_training and s2.serie = 2
join data as s3 on s1.id_training = s3.id_training and s3.serie = 3
where s1.serie = 1;