--select * from spg_pegawai where handphone like '%9916886%' or handphone2 like '%9916886%' or handphone_1 like '%9916886%' or handphone_2 like '%9916886%' 

SELECT
	sdc.NIP,
	sdc.NM_PEG,
	sdc.TGL_LAHIR_PEG,
	YEAR(GETDATE()) - YEAR(sdc.TGL_LAHIR_PEG) AS tahun,
	sdc.KD_JABATAN_STR,
	sdc.NM_JABATAN,
	sdc.NM_ESELON,
	sp.handphone,
	sp.handphone2,
	sp.handphone_1,
	sp.handphone_2,
	sp.STS_PENERIMAAN_PEG,
	CASE sp.STS_PENERIMAAN_PEG
		WHEN '100' THEN 'PCT (Pendidikan Calon PTU)'
          WHEN '200' THEN 'PCS (Pendidikan Calon Staf)'
          WHEN '300' THEN 'PCP (Pendidikan Calon Pejabat)'
          WHEN '400' THEN 'PCE (Pendidikan Calon Staf Edukasi dan Perlindungan Konsumen)'
          WHEN '500' THEN 'Ex Penugasan'
          WHEN '600' THEN 'Ex PKWT'
		ELSE ''
	END AS [Status Penerimaan Pegawai],
	sp.ANGKATAN AS Angkatan,
	sp.TAHUN_PEREKRUTAN AS Tahun
FROM
	SPG_DATA_CURRENT AS sdc INNER JOIN
	SPG_08_UNIT_ORGANISASI AS suo ON sdc.KD_UNIT_ORG = suo.KD_UNIT_ORG LEFT JOIN
	SPG_PEGAWAI AS sp ON sdc.NIP = sp.NIP
WHERE
	sdc.STS_PENSIUN = '0'
	AND suo.nama_satker_organisasi = 'Grup Pengembangan Aplikasi Sistem Informasi'
	--AND sdc.NM_PEG LIKE '%adnan%'
ORDER BY
	sdc.KD_JABATAN_STR,
	YEAR(sdc.TGL_LAHIR_PEG) ASC,
	sdc.NM_PEG

SELECT distinct nama_satker_organisasi from SPG_08_UNIT_ORGANISASI order by nama_satker_organisasi