INSERT INTO BV_W001 SELECT '01005f01f6cc74acc460a69604e7ca32',000000,'0',MEISAI.VKEY1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,SUM(CASE MEISAI.VPERIOD WHEN '201101' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201102' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201103' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201104' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201105' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201106' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201107' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '' THEN MEISAI.VD1 ELSE 0 END)
,SUM(CASE MEISAI.VPERIOD WHEN '201101' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201102' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201103' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201104' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201105' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201106' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201107' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '' THEN 0 ELSE 0 END)
,SUM(CASE MEISAI.VPERIOD WHEN '201101' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201102' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201103' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201104' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201105' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201106' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201107' THEN MEISAI.VD1 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '' THEN MEISAI.VD1 ELSE 0 END)
,SUM(CASE MEISAI.VPERIOD WHEN '201101' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201102' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201103' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201104' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201105' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201106' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '201107' THEN 0 ELSE 0 END) ,SUM(CASE MEISAI.VPERIOD WHEN '' THEN 0 ELSE 0 END)
FROM MVIEW0011_YYYYMM MEISAI
WHERE  MEISAI.VPERIOD BETWEEN '201101' AND '201107'
GROUP BY MEISAI.VKEY1

,VKEY1,' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',SUM(VD1),0,SUM(VD1),0
 VPERIOD BETWEEN '201101' AND '201107'
 ,VKEY1

 VPERIOD BETWEEN '2012' AND '2012'


