Select all rows that have no children
select yt.name
from YourTable yt
where not exists (select null from YourTable where parentID = yt.id)
Although less efficient (see: Left outer join vs NOT EXISTS), you could also do this with a left join:
select yt1.name
from YourTable yt1
left join YourTable yt2
on yt1.id = yt2.parentID
where yt2.id is null
select t.name
from that_table t
where t.id not in (select parentID from that_table);