--SELECT
--	*
--FROM
--	dbo.Note_Terbit_Master
--WHERE
--  No_Ref = '2015.085985'

--SELECT
--	ppd.*
--FROM
--	dbo.Peserta_Produk_Detail AS ppd INNER JOIN
--	dbo.Peserta AS p ON ppd.No_Proposal = p.No_Proposal
--	                    AND ppd.No_Peserta = p.No_Peserta
--WHERE
--  ppd.No_Ref = '2015.085985'

-----------contoh-----------
SELECT
	ppd.*
FROM
	dbo.Peserta_Produk_Detail AS ppd INNER JOIN
	dbo.Peserta AS p ON ppd.No_Proposal = p.No_Proposal
	                    AND ppd.No_Peserta = p.No_Peserta
WHERE
  ppd.No_Ref = '2015.085985'
  AND ppd.No_Peserta = '1996000553-0'
SELECT
  '' AS No_Ref,
  pp.No_Peserta,
  pp.Id_Produk,
  pp.Tgl_Mulai,
  pp.Tgl_Selesai,
  pp.Tgl_Ubah,
  pp.Pay_Date,
  pp.Status,
  pp.No_Proposal,
  pp.Sub_Kelompok,
  --pp.Next_Pay,
  p.Kelamin,
  --p.Usia,
  dbo.func_GetUmur(p.Tgl_Lahir, p.Tgl_Mulai) AS Usia, 
  p.Status_Kawin,
  pp.No_Induk,
  p.Sebagai,
  p.Cabang,
  pp.Kelas,
  pp.Resiko,
  pp.Benefit,
  pp.Premi,
  pp.Santunan,
  pp.Ekstra_Premi,
  pp.Curr_Premi,
  pp.Curr_Santunan,
  pp.Santunan_Duka,
  pp.Santunan_Cacat,
  pp.Santunan_Lain,
  pp.Kelamin_Old,
  pp.Usia_Old,
  pp.Status_Kawin_Old,
  pp.Cabang_Old,
  pp.Kelas_Old,
  pp.Resiko_Old,
  pp.Benefit_Old,
  pp.Premi_Old,
  pp.Santunan_Old,
  pp.Ekstra_Premi_Old,
  pp.Curr_Premi_Old,
  pp.Curr_Santunan_Old,
  pp.Santunan_Duka_Old,
  pp.Santunan_Cacat_Old,
  pp.Santunan_Lain_Old,
  pp.Adm_Keluar,
  pp.Jml_Klaim,
  pp.Jumlah,
  pp.Jenis,
  pp.Status_Old AS Status1,
  'SYS' AS Change_By, --pp.Change_By,
  dbo.func_FixedDate(GETDATE()) AS Change_Date,  --pp.Change_Date,
  'SYS' AS Create_By, --pp.Create_By,
  dbo.func_FixedDate(GETDATE()) AS Create_Date,  --pp.Create_Date,
  pp.adm_prosen
  --pp.Tgl_Trans,
  --pp.Prop_Santunan,
FROM
  dbo.Peserta AS p INNER JOIN
	dbo.Peserta_Produk AS pp ON p.No_Proposal = pp.No_Proposal
	                            AND p.No_Peserta = pp.No_Peserta
WHERE
  pp.No_Proposal = '2014.0783'
  AND pp.No_Peserta = '1996000553-0'
  AND pp.Sub_Kelompok = '0100'