Crystal Reports select 语句帮助

发布于 2024-10-07 00:06:41 字数 657 浏览 2 评论 0原文

我正在尝试添加 MV_AgeBased 和 MV_FeeInLieu 列,但是某些列在数据库中可能为 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'

I'm attempting to add the MV_AgeBased and the MV_FeeInLieu columns, however some of the columns may have null or empty in the db, this results in bringing back zeroes for that CodeEntity. Any suggestions?

        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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

没企图 2024-10-14 00:06:41
    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] is not null”?

不太确定这里要问什么。

    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')

Add "WHERE [column] is not null" for all the potentially null columns?

Not absolutely sure what is being asked, here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文