mysql select distinct values and count of each