group by for doctors