Can values in your ID column be reused? If no, then juergen's answer will work. If they can be reused, you will need to use the same table twice in your query, once to get the max id for each parent id, and once to get the row for each max id/parent id. Like so:
select
t1.*
from aTable t1,
(select parentid, max(id) as id
from aTable group by parentid) t2
where t1.id = t2.id
and t1.parentid = t2.parentid