PINDAH BERDASARKAN ALASAN REKAP

PINDAH BERDASARKAN ALASAN

SELECT to_char(CREATED_DATE,'YYYY-MM') TAHUN_BULAN
, 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_HEADER
WHERE TO_CHAR(CREATED_DATE,'YYYY') ='2019'
AND from_no_prop =&1 and from_no_kab=&2
GROUP BY to_char(CREATED_DATE,'YYYY-MM')
ORDER BY 1;

Subscribe to receive free email updates:

0 Response to "PINDAH BERDASARKAN ALASAN REKAP"

Posting Komentar