Guest User

Untitled

a guest
Sep 4th, 2015
510
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT refppk.NMPPK, datsjp.jnspelsjp, COUNT(datsjp.nosjp) AS JUMLAH_KASUS, SUM(datsjp.BYSTJSJP) AS TOTAL_BIAYA
  2. FROM DATSJP
  3. INNER JOIN REFPPK ON DATSJP.PPKPELSJP=refppk.KDPPK
  4. WHERE datsjp.NOSJP IN (
  5. SELECT datsjp.nosjp
  6. FROM DATSJP
  7. INNER JOIN DATNKAPST ON DATSJP.NOKAPST = DATNKAPST.NOKAPST
  8. INNER JOIN REFPPK ON refppk.KDPPK=datnkapst.PPKPST
  9. WHERE (datsjp.tglplgsjp BETWEEN '2015-01-01' AND '2015-07-31') AND (datsjp.nofpk IS NOT NULL OR datsjp.nofpk <>'') AND refppk.KDKC<>'1308'
  10. )
  11. GROUP BY refppk.NMPPK,datsjp.JNSPELSJP
  12. ORDER BY refppk.NMPPK ASC,datsjp.JNSPELSJP ASC;
RAW Paste Data