• + 2 comments

    because in GROUP BY you need to add all expression used in select except the agreegation expression like count(distinct lm.lead_manager_code).