DECLARE
  @no_proposal VARCHAR(12)
  
SET @no_proposal = '2013.0740' -- isi ini (No Proposal) dan isi No Klaim dibawah


UPDATE
  kp
SET
  kp.Id_Produk = CASE
                   WHEN pp.Id_Produk IS NULL THEN pp2.Id_Produk
                   ELSE pp.Id_Produk
                 END
FROM
  dbo.Klaim_Peserta AS kp LEFT JOIN
  dbo.Peserta_Produk AS pp ON kp.No_Proposal = pp.No_Proposal AND kp.No_Peserta = pp.No_Peserta AND kp.Sub_Kelompok = pp.Sub_Kelompok INNER JOIN
  ( SELECT
      No_Proposal,
      No_Peserta,
      Id_Produk,
      Sub_Kelompok
    FROM
      dbo.Peserta_Produk
    WHERE
      No_Proposal = @no_proposal
      AND No_Peserta LIKE '%0'
  ) AS pp2 ON kp.No_Proposal = pp2.No_Proposal AND SUBSTRING(kp.No_Peserta,1,10) = SUBSTRING(pp2.No_Peserta,1,10) AND kp.Sub_Kelompok = pp2.Sub_Kelompok
WHERE
  kp.No_Proposal = @no_proposal
  AND kp.Status = 'G'
  --AND kp.No_Peserta NOT LIKE '%0'
  AND kp.No_Klaim IN (
'2014.448559',
'2014.448692',
'2014.448726',
'2014.448687',
'2014.448809',
'2014.448894',
'2014.448927',
'2014.448928',
'2014.448957',
'2014.448724',
'2014.448730',
'2014.448732',
'2014.448759',
'2014.448760',
'2014.448870',
'2014.448872',
'2014.448910',
'2014.449508',
'2014.449974',
'2014.449977',
'2014.450011',
'2014.450066',
'2014.450026',
'2014.450078')