select sum(commission) from tablname where condition group by country
select count(*) from ( select country from tablname where condition group by country having sum(commission)>0 ) a
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)