DECLARE @tmp_pst TABLE ( no_peserta VARCHAR(12))

INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013023144-4')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007236-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013023499-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013023499-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020626-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020626-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020626-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020626-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020626-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013023499-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013028051-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013028051-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010698-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010698-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013029020-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013021842-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013021842-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010697-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010697-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013032384-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010700-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010700-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006333-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006564-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006992-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007236-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007236-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007604-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007543-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007599-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007753-4')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007143-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007143-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007050-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006326-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013034314-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013040718-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013032384-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010604-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010722-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010722-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010722-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010722-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007353-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007353-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007193-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007268-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007349-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007731-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007731-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007731-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007143-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007747-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010700-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013029879-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010700-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006991-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006562-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007128-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007040-4')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007040-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006480-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006375-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013019797-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010704-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010718-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013032384-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020619-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013020619-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013015224-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007225-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007551-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007998-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010711-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010704-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010711-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013029840-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006390-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006375-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006333-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006382-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007131-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006457-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006432-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006422-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007086-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013010704-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013008003-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013040548-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013032394-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013023499-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013032394-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007939-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007581-3')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007729-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013007230-1')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006375-2')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013006326-0')
INSERT INTO @tmp_pst ( no_peserta ) VALUES ('2013027989-0')


SELECT
  *
FROM
  @tmp_pst
WHERE
  no_peserta NOT IN (
  SELECT
    No_Peserta_Lama
  FROM
    dbo.temp_prib_mapping_peserta_mugirekso
  )


------------------------------------------

SELECT
  *
FROM
  dbo.temp_prib_mapping_peserta_mugirekso AS tmp INNER JOIN
  (
    SELECT
      x.Nama,
      x.Tgl_Lahir,
      x.jml
    FROM
      (
        SELECT
          Nama,
          Tgl_Lahir,
          COUNT(*) AS jml
        FROM
          dbo.temp_prib_mapping_peserta_mugirekso
        GROUP BY
          Nama,
          Tgl_Lahir
      ) AS x
    WHERE
      x.jml>1
  ) AS y ON tmp.Nama = y.Nama AND tmp.Tgl_Lahir = y.Tgl_Lahir
ORDER BY
  tmp.Nama

------------------------------------------
-- cek yg dobel
SELECT
  *
FROM
  (
    SELECT
      a.No_Proposal_Baru,
      a.Nama,
      COUNT(*) AS jml
    FROM
      (
        SELECT
          No_Proposal_Baru,
          Nama
        FROM
          (
            SELECT
              tmp.No_Proposal_Lama,
              tmp.No_Proposal_Baru,
              tmp.No_Peserta_Lama,
              tmp.No_Peserta_Baru,
              tmp.Nama,
              tmp.Tgl_Lahir
            FROM
              dbo.temp_prib_mapping_peserta_mugirekso AS tmp INNER JOIN
              (
                SELECT
                  x.Nama,
                  x.Tgl_Lahir,
                  x.jml
                FROM
                  (
                    SELECT
                      Nama,
                      Tgl_Lahir,
                      COUNT(*) AS jml
                    FROM
                      dbo.temp_prib_mapping_peserta_mugirekso
                    GROUP BY
                      Nama,
                      Tgl_Lahir
                  ) AS x
                WHERE
                  x.jml>1
              ) AS y ON tmp.Nama = y.Nama AND tmp.Tgl_Lahir = y.Tgl_Lahir
          ) AS z
        GROUP BY
          z.No_Proposal_Baru,
          z.Nama
      ) AS a
    GROUP BY
      a.No_Proposal_Baru,
      a.Nama
  ) AS b
WHERE
  b.jml > 1