Use count(distinct)
:
select salesname, count(distinct customername) as num_customers,
count(*) as num_orders
from t
group by salesname;
2
solved count in mysql by each value [closed]
Use count(distinct)
:
select salesname, count(distinct customername) as num_customers,
count(*) as num_orders
from t
group by salesname;
2
solved count in mysql by each value [closed]