USE [GrpInsuranceUAT]
GO

/****** Object:  View [dbo].[custPort_ind_Province]    Script Date: 19/11/2018 11.48.55 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- last modified by Pribadi Pamungkas. 2018-11-19
-- catatan: perlu disesuaikan dengan SP custPort_Proc_Info_Provider

ALTER VIEW [dbo].[custPort_ind_Province]
AS
  --SELECT
	 -- province,
	 -- country
  --FROM
	 -- dbo.custport_provider
  --WHERE
  --  is_aai = 1
  --GROUP BY
  --  province,
	 -- country

	SELECT
		w.Nama AS province,
		'Indonesia' AS country
	FROM
		[dbo].[Provider] AS rs INNER JOIN
		[dbo].[kontrak_provider] AS kp ON rs.IDI = kp.kode_provider LEFT JOIN
		[dbo].[Wilayah] AS w ON rs.Kode_Wilayah = w.Kode
	WHERE
		COALESCE(w.Nama,'') <> ''
    GROUP BY
		w.Nama


GO


