Делает ли это то, что вы хотите?
select (case when cnt_type_0 > 0 and cnt_type_1 > 0
then 'Condition 1'
when cnt_type_1 = 0
then 'Condition 2'
when cnt_type_0 = 0
then 'Condition 3'
end) as condition,
t.*
from (select t.*,
count(*) over (partition by ID, PERSNR, YEARNR, MONTHNR, DAYNR, ABSTIME, ABSID, ABSCALC) as cnt,
sum(case when TypeLine = 0 then 1 else 0 end) over (partition by ID, PERSNR, YEARNR, MONTHNR, DAYNR, ABSTIME, ABSID, ABSCALC) as cnt_type_0,
sum(case when TypeLine = 1 then 1 else 0 end) over (partition by ID, PERSNR, YEARNR, MONTHNR, DAYNR, ABSTIME, ABSID, ABSCALC) as cnt_type_1
from t
) t
where cnt >= 2;
Вы можете добавить условия в предложение WHERE
, чтобы получить строки только одного типа.