sql insert into select语句写法-将查询结果直接插入到表中

 

 

insert into month_gpcj_info(idStr,zszrmygpsl,xyzrmygpsl,mycje,mycjl,month_date,dataCompiledDate) select UUID() idstr,
max(m.GPGSZSZhuanRangShu) zszrmygpsl,max(m.GPGSXYZhuanRangShu) xyzrmygpsl,
sum(m.CJHeJiJinE) mycje,sum(m.RJCJGPHeJi) mycjl ,'201501' month_date,'2015-09-01' dataCompiledDate 
from market_scope_statistics m  
where m.dataCompiledDate like '2015-01-%';

 

posted @ 2015-09-01 15:11  243573295  阅读(1143)  评论(0编辑  收藏  举报