Ver originalSELECT t1.id, COUNT(t1.id) AS totalFROM tabla t1,tabla t2WHERE t1.id = t2.parentGROUP BY t1.idORDER BY total DESC