select a.uid, a.start_month, count(start_month) as total_cnt, count(score) as complete_cnt from ( select a.uid, date_format(...