【发布时间】:2017-06-08 06:50:19
【问题描述】:
我需要从包含NoOfErrors 和NoOfAudited 列的表中的SQL Server 数据库表中计算和检索数据。
我需要根据这些列计算准确度。
我有这样的查询
select
a.id,
(100-((a.NoOfErrors*100)/ NULLIF(a.NoOfAudited,0))) as Accuracy
from Table1 a
join Table2 pd
on a.batchid=pd.id
where
a.charge='"+Poster+"' and status=1
仅当NoOfErrors 和NoOfAudited 列包含某些值时,才会执行上述查询。
我拥有所有值,但如果NoOfErrors 和NoOfAudited 列中的任何一个值包含Null 值,则它不会检索任何数据,而是显示No data found。
ResultSet 数据不接受空值
如何让查询接受空值并通过将jsp表中的空替换为空来检索数据?
【问题讨论】:
标签: java sql-server jsp