SCRIPT CARI REKAP DATANG BERDASARKAN ALASAN

DATANG BERDASARKAN ALASAN REKAP
SELECT to_char(b.tgl_datang,'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 a, datang_header b where a.no_pindah=b.no_pindah
and no_prop=&1 and no_kab=&2
and TO_CHAR(b.tgl_datang,'YYYY') ='2019'
GROUP BY to_char(b.tgl_datang,'YYYY-MM')
ORDER BY 1;

Subscribe to receive free email updates:

0 Response to "SCRIPT CARI REKAP DATANG BERDASARKAN ALASAN"

Posting Komentar