USE [IndInsurance]
GO


SELECT * FROM item_klaim WHERE LEFT(id_item_klaim,4)='0186'

SELECT DISTINCT polis.id_plan_dasar, plan_asuransi.deskripsi AS nama_plan
FROM polis INNER JOIN
  plan_asuransi ON polis.id_plan_dasar=plan_asuransi.id_plan
WHERE id_plan_dasar+id_plan_dasar NOT IN (SELECT id_item_klaim FROM item_klaim) ORDER BY id_plan_dasar

SELECT * FROM polis WHERE id_plan_dasar='0188' AND id_polis=dbo.func_get_id_polis_per_tanggal(no_polis,'2013-06-12',0)