下面是我的查询,我需要显示零计数的邮政编码
选择propertyzip as Zip, Zip.city as City, zip.fips as Fips, Propertystate as state, Count(*) as Total From dbo.proplistsource a, Zipcode.dbo.zip Zip, Zipcode.dbo.cnty where cnty.fips = zip.fips and zip.zip = a.propertyzip and zip.ll = 'L' and Propertyzip in ('37849', '37909', '37914', '37918', '37921', '37923', '37931') and a.propid in (Select max(propid) from dbo.proplistsource b where b.Propertyzip in ('37849', '37909', '37914', '37918', '37921', '37923', '37931') and propertyusestandardized in ('181')) group by propertyzip, zip.City, zip.Fips, Propertystate
答案 0 :(得分:1)
您需要在底部使用having
子句,例如:
...<your query>...
having count(*) < 1