我有一个查询,我想返回零值且被卡住的计数。
SELECT count(distinct vptp.intraorg_patient_id) as PatientCount, vpd.provider_name as ProviderName, vpd.provider_type as ProviderType
FROM "SUPERMART_152".v_patient_to_provider vptp
join supermart_152.v_provider_dim vpd
on vptp.provider_id = vpd.provider_id
WHERE vptp.provider_id IN (SELECT DISTINCT ocpe.child_provider
FROM supermart_152.v_org_chart_provider_edge ocpe
WHERE ocpe.orgchart_version IN
(SELECT org_chart_version_id
FROM supermart_152.v_org_chart_version
WHERE org_chart_status = 1))
and vptp.reference_date = CURRENT_DATE -2
group by 2,3
order by 2,3
我得到正常结果,但是我知道应该有一个计数为零的结果。