-- making testdata
declare @sample table(id int, parent_id int, artikel_id int)
insert @sample
select 1, NULL, 87585 union all
select 2, NULL, 55973 union all
select 3, NULL, 18753 union all
select 4, 2, 85112 union all
select 5, 2, 11883 union all
select 6, 1, 25123 union all
select 7, NULL, 99983
-- show testdata
select * from @sample
-- solution
select * from @sample as t1
where not exists(select * from @sample as t2 where t1.id = t2.parent_id)
and t1.parent_id is null
Too old to Rock'n'Roll too young to die.