SELECT SUM ((((se_cov1val + se_cov2val) + se_cov3val) + se_cov4val))
           AS "10",
       SUM (se_site_limit)
           AS "11",
       SUM (se_cov1val)
           AS "12",
       SUM (se_cov2val)
           AS "13",
       SUM (se_cov3val)
           AS "14",
       SUM (se_cov4val)
           AS "15",
       SUM (se_site_deduct)
           AS "17",
       SUM (se_risk_count)
           AS "21",
       SUM (se_cov1limit)
           AS "143",
       SUM (se_cov1deduct)
           AS "144",
       SUM (se_cov2limit)
           AS "145",
       SUM (se_cov3limit)
           AS "147",
       SUM (se_cov3deduct)
           AS "148",
       SUM (se_cov4limit)
           AS "149",
       SUM (se_cov4deduct)
           AS "150",
       SUM (se_site_bl_deduct)
           AS "212",
       SUM (se_agg_limit)
           AS "213",
       SUM (se_site_bl_limit)
           AS "211",
       SUM (pe_premium)
           AS "93",
       SUM (pe_policy_deduct)
           AS "92",
       SUM (pe_undercover)
           AS "127",
       SUM (pe_prorata)
           AS "126",
       SUM (pe_policy_bl_deduct)
           AS "139",
       SUM (pe_policy_bl_grosslimit)
           AS "142",
       SUM (pe_policy_limit)
           AS "128",
       SUM (pe_agg_deduct)
           AS "155"
  FROM (SELECT SUM (se.site_limit)     AS se_site_limit,
               SUM (se.cov1val)        AS se_cov1val,
               SUM (se.cov2val)        AS se_cov2val,
               SUM (se.cov3val)        AS se_cov3val,
               SUM (se.cov4val)        AS se_cov4val,
              SUM (se.site_deduct)    AS se_site_deduct,
               SUM (se.risk_count)     AS se_risk_count,
               SUM (se.cov1limit)      AS se_cov1limit,
               SUM (se.cov1deduct)     AS se_cov1deduct,
               SUM (se.cov2limit)      AS se_cov2limit,
               SUM (se.cov3limit)      AS se_cov3limit,
               SUM (se.cov3deduct)     AS se_cov3deduct,
               SUM (se.cov4limit)      AS se_cov4limit,
               SUM (se.cov4deduct)     AS se_cov4deduct,
               SUM (se.site_bl_deduct) AS se_site_bl_deduct,
               SUM (se.agg_limit)      AS se_agg_limit,
               SUM (se.site_bl_limit)  AS se_site_bl_limit,
               se.peril_id             AS se_peril_id,
               se.portfolio_id         AS se_portfolio_id,
               se.account_id           AS se_account_id
          FROM ap.site_exposure se
         WHERE     se.portfolio_id = -1192662
GROUP BY se.peril_id,se.portfolio_id,se.account_id
) s
INNER JOIN
(
SELECT SUM(pe.premium) AS pe_premium,SUM(pe.policy_deduct) AS pe_policy_deduct,SUM(pe.undercover) AS pe_undercover,SUM(pe.prorata) AS pe_prorata,SUM(pe.policy_bl_deduct) AS pe_policy_bl_deduct,SUM(pe.policy_bl_grosslimit) AS pe_policy_bl_grosslimit,SUM(pe.policy_limit) AS pe_policy_limit,SUM(pe.agg_deduct) AS pe_agg_deduct,pe.peril_id AS pe_peril_id,pe.portfolio_id AS pe_portfolio_id,pe.account_id AS pe_account_id
FROM ap.policy_exposure pe 
WHERE pe.portfolio_id = -1192662 
 GROUP BY pe.peril_id,pe.portfolio_id,pe.account_id
) p
ON (s.se_peril_id=p.pe_peril_id AND s.se_account_id=p.pe_account_id AND s.se_portfolio_id=p.pe_portfolio_id)
WHERE s.se_portfolio_id= -1192662
