SELECT * FROM temp_prib_peserta_map WHERE [COMPANY NAME]='PT.MITRA ADIPERKASA Tbk'
SELECT * FROM dbo.Peserta WHERE No_Proposal='2016.0253'

SELECT
	--tmp.*,
	--aoc.id_area,
	--c.id_country
	pst.*
FROM
	dbo.temp_prib_peserta_map AS tmp INNER JOIN
	dbo.Peserta AS pst ON tmp.[Full Name]=pst.Nama AND tmp.[DATE OF BIRTH]=pst.Tgl_Lahir LEFT JOIN
	dbo.area_of_cover AS aoc ON tmp.[AREA OF COVER]=aoc.description LEFT JOIN
	dbo.country AS c ON tmp.[COUNTRY OF RESIDENCE]=c.description
WHERE
  --pst.No_Proposal='2016.0253'
  pst.No_Proposal IN (
                      SELECT
	                      pa.No_Proposal
                      FROM
	                      dbo.Polis_Asuransi AS pa INNER JOIN
	                      dbo.Perusahaan AS prs ON pa.No_Prs = prs.No_Prs
                      WHERE
                        prs.Group_Perusahaan=23017
                        AND pa.Status='I'
                     )
  AND pst.Status='I'

--UPDATE
--  pst
--SET
--  id_country=c.id_country,
--  id_area=aoc.id_area
--FROM
--	dbo.temp_prib_peserta_map AS tmp INNER JOIN
--	dbo.Peserta AS pst ON tmp.[Full Name]=pst.Nama AND tmp.[DATE OF BIRTH]=pst.Tgl_Lahir LEFT JOIN
--	dbo.area_of_cover AS aoc ON tmp.[AREA OF COVER]=aoc.description LEFT JOIN
--	dbo.country AS c ON tmp.[COUNTRY OF RESIDENCE]=c.description
--WHERE
--  --pst.No_Proposal='2016.0253'
--  pst.No_Proposal IN (
--                      SELECT
--	                      pa.No_Proposal
--                      FROM
--	                      dbo.Polis_Asuransi AS pa INNER JOIN
--	                      dbo.Perusahaan AS prs ON pa.No_Prs = prs.No_Prs
--                      WHERE
--                        prs.Group_Perusahaan=23017
--                        AND pa.Status='I'
--                     )
--  AND pst.Status='I'


SELECT
	pst.*,
	aoc.description AS area_of_country,
	c.description AS country
FROM
	dbo.Peserta AS pst LEFT JOIN
	dbo.area_of_cover AS aoc ON pst.id_area = aoc.id_area LEFT JOIN
	dbo.country AS c ON pst.id_country = c.id_country
WHERE
  No_Proposal = '2016.0253'