Mzsmunna
10/15/2019 - 10:08 AM

SQL Select --Distinct Where Not In

select distinct MEAS_ID from MemberMiscellaneousInformationTemps
where MEAS_ID not in(select HedisCode from MeasureCodeOverview)

SELECT  distinct [Contract ID]
FROM    dbo.CPSC_Contract_Info_2019_09
WHERE   [Contract ID] NOT IN (SELECT Enrollment_V1.dbo.CPSC_Contract_Info.ContractID FROM Enrollment_V1.dbo.CPSC_Contract_Info )

SELECT  distinct [Contract ID]
FROM   CMS_DB.dbo.CPSC_Contract_Info_2019_09
WHERE   [Contract ID] NOT IN (SELECT ContractID FROM Enrollment_V1.dbo.CPSC_Contract_Info )

SELECT  distinct [Plan ID]
FROM   CMS_DB.dbo.CPSC_Contract_Info_2019_09
WHERE   [Plan ID] NOT IN (SELECT PlanID FROM Enrollment_V1.dbo.CPSC_Contract_Info )