Ver originalSELECT id_a, count(a_id) AS total_a_en_b from tabla_b LEFT JOIN tabla_a ON id_a = a_id GROUP BY a_id