SELECT t.id,t.item,t.parentID
,(select count(*) from table s where s.parentID = t.id) as count
from table t
counts for each id how many childs he have.
SELECT t.id,t.item,t.parentID
,(select count(*) from table s where s.parentID = t.id) as count
from table t
counts for each id how many childs he have.