insert into 表2 select 字段1,字段2,。。。。from 表1 where 条件
详细看http://hi.baidu.com/%CE%F2%BF%D5%CA%F4%B9%B7/blog/item/2842e5ce1ca8f95a0fb34583.html
create procedure P_查询
insert into table2(select * from table1 where 条件)
纯SQL写出这个样式来是比较麻烦的。
你可以换一种思路
从你图片上来看,明显这是一个报表的统计样式。
你可以将时间与项目的合集在每个状态的值查询出来,利用报表进行横纵分组从而得到每个状态的值
写成select into 不就好了吗