If you're on V9 use analytics instead, I think it will be faster than John's suggestion
select id,type,name
from
(
select count(*) over(partition by id order by type) cnt,id,type,name
from your_table
) where cnt = 1
In order to understand recursion, you must first understand recursion.