What you need to do is to JOIN the table back onto itself.
Play around with this sample
DECLARE @Table TABLE (ID INT, ParentID INT)
INSERT @Table VALUES (1, 0), (2, 0), (3, 0), (4, 3), (5, 3), (6, 2)
DECLARE @ParentID INT = 0
SELECT p.ID, p.ParentID, Matches = case count(c.ID) when 0 then 0 else 1 end
FROM @Table P
FULL JOIN @Table c on p.id = c.parentID
WHERE p.ParentID = @ParentID
GROUP BY p.ID, p.ParentID