SELECT date_num/12 [year], date_num%12+1 [month], num FROM( SELECT YEAR(register_date)*12+MONTH(register_date)-1 date_num,count(*) num FROM [user] GROUP BY YEAR(register_date)*12+MONTH(register_date)-1) as t