SCRIPT PINDAH BERDASARKAN ALASAN DAN JENIS KELAMIN DETAIL

PINDAH BERDASARKAN ALASAN DAN JENIS KELAMIN DETAIL 


SELECT to_char(b.CREATED_DATE,'YYYY-MM') TAHUN_BULAN, decode(jenis_klmin, 1,'LAKI-LAKI',2,'PEREMPUAN') JENIS_KLMIN
, SUM (CASE WHEN ALASAN_PINDAH=1 THEN 1 ELSE 0 END) PEKERJAAN
, SUM (CASE WHEN ALASAN_PINDAH=2 THEN 1 ELSE 0 END) PENDIDIKAN
, SUM (CASE WHEN ALASAN_PINDAH=3 THEN 1 ELSE 0 END) KEAMANAN
, SUM (CASE WHEN ALASAN_PINDAH=4 THEN 1 ELSE 0 END) KESEHATAN
, SUM (CASE WHEN ALASAN_PINDAH=5 THEN 1 ELSE 0 END) PERUMAHAN
, SUM (CASE WHEN ALASAN_PINDAH=6 THEN 1 ELSE 0 END) KELUARGA
, SUM (CASE WHEN ALASAN_PINDAH=7 THEN 1 ELSE 0 END) LAINNYA
, SUM (CASE WHEN ALASAN_PINDAH<8 THEN 1 ELSE 0 END) JUMLAH
FROM pindah_detail a, pindah_header b where
a.no_pindah =b.no_pindah
and TO_CHAR(b.CREATED_DATE,'YYYY') ='2019'
- GANTI NO_PROP DAN NO_KAB
AND from_no_prop =&1 and from_no_kab =&2
GROUP BY to_char(b.CREATED_DATE,'YYYY-MM'), jenis_klmin
order by 1;

Subscribe to receive free email updates:

0 Response to "SCRIPT PINDAH BERDASARKAN ALASAN DAN JENIS KELAMIN DETAIL "

Posting Komentar