What postgres query I can use for the below scenario ?
Parent table:
Child table:
My expected result
Explanation:
Parent1 –> 4 equipments ( Parent1 has Child1 holding 3 equipment and Child2 holding 1 equipment) )
Parent2 –> 3 equipments ( Parent2 has Child3 holding 2 equipment and Child4 holding 1 equipment)