I have a SQL statement:
select
tms.Team, Count(tms.MSApprovedNPC) as JulyNPCResults
from
tmsorder2 tms
where
Msapprovednpc not in ('N/A','No') and Month(Month) = 11 and Year(month) = '2013'
group by
tms.Team
these results are for a specific month of July 2013.
Now I want to load the results in a table NPRData for other months in to one table which has columns like
TEAM, JulyNPRResults, AugNPRResults, SepNPRResults, OctNPRResults
How can I loop the above query to insert data for other months?
Thanks in advance