SELECT c1.id, c1.title, (select count(*) from categories c2 where c2.parent=c1.id) child_count FROM categories c1 WHERE c1.parent =1 ORDER BY c1.id ASC
SELECT c1.id, c1.title, (select count(*) from categories c2 where c2.parent=c1.id) child_count FROM categories c1 WHERE c1.parent =9 ORDER BY c1.id ASC
SELECT c1.id, c1.title, (select count(*) from categories c2 where c2.parent=c1.id) child_count FROM categories c1 WHERE c1.parent =2 ORDER BY c1.id ASC
SELECT c1.id, c1.title, (select count(*) from categories c2 where c2.parent=c1.id) child_count FROM categories c1 WHERE c1.parent =16 ORDER BY c1.id ASC
SELECT c1.id, c1.title, (select count(*) from categories c2 where c2.parent=c1.id) child_count FROM categories c1 WHERE c1.parent =17 ORDER BY c1.id ASC