Possible Duplicate:
Insert data from to a table
From the main Tax table, I want to be able to do a computation and write the output into a new table.
select zipcode, sum(A00100)/sum(N1) as 'avg_agi' from taxbyzip2008 group by zipcode;
The new table to be named avgagi will have two fields (columns), the zipcode and avg_agi.
I know how to create a new table, but I don't know how to take the output from the above select and have it written to the new table avgagi and populate it with zipcode and avg_agi. Thanks!
do your create table and then
insert into avgagi
select zipcode, sum(A00100)/sum(N1) as 'avg_agi' from taxbyzip2008 group by zipcode;