我正在尝试添加MV_AgeBased和MV_FeeInLieu列,但是db中的某些列可能为null或为空,这会导致为该CodeEntity带回零。有什么建议吗?
SELECT "AuditorYearEnd"."PP_MH_Pri", "AuditorYearEnd"."PP_MH_Other",
"County"."Name", "AuditorYearEnd"."TOTAL_Personal_calc",
"AuditorYearEnd"."PP_BusPersonal", "AuditorYearEnd"."TaxYr",
"AuditorYearEnd"."CodeEntity", "AuditorYearEnd"."MV_AgeBased",
"AuditorYearEnd"."MV_FeeInLieu"
FROM "txctr"."dbo"."AuditorYearEnd" "AuditorYearEnd"
INNER JOIN "txctr"."dbo"."County" "County" ON "AuditorYearEnd"."CodeCounty"="County"."CodeCounty"
WHERE "AuditorYearEnd"."TaxYr"=2010 AND "AuditorYearEnd"."CodeEntity"='1010'
答案 0 :(得分:0)
SELECT "AuditorYearEnd"."PP_MH_Pri", "AuditorYearEnd"."PP_MH_Other",
"County"."Name", "AuditorYearEnd"."TOTAL_Personal_calc",
"AuditorYearEnd"."PP_BusPersonal", "AuditorYearEnd"."TaxYr",
"AuditorYearEnd"."CodeEntity", "AuditorYearEnd"."MV_AgeBased",
"AuditorYearEnd"."MV_FeeInLieu"
FROM ("txctr"."dbo"."AuditorYearEnd" "AuditorYearEnd"
INNER JOIN "txctr"."dbo"."County" "County" ON "AuditorYearEnd"."CodeCounty"="County"."CodeCounty"
WHERE "AuditorYearEnd"."TaxYr"=2010 AND "AuditorYearEnd"."CodeEntity"='1010')
为所有可能为空的列添加“WHERE [column] not null”?
不完全确定这里有什么问题。