select n2.name,count(*) from datastore as n1, datastore as n2 where n2.name=n1.name and n2.yearmonth=200207 and n1.yearmonth<200207 group by n2.name;