有几个表,表名为B001C001,B001C002,B001C003,B001C004,B001C005,B001C006,A001A001。其中要求B001C001,B001C001,B001C001,B001C001中每个字段B0148=‘02’和A001A001表中字段A0107='02'的数量和,并显示。
完整的代码是:
 DataTable rzCount = SQLServerHelper.ExecuteTable(select SUM(a) as fcount from 
(select count (B0128) as a from B001C001 where B0128='02' union all
 select count (B0128) as a from B001C002 where B0128='02' union ALL 
select count (B0128) as a from B001C003 where B0128='02' union ALL 
select count (B0128) as a from B001C004 where B0128='02' union ALL 
select count (B0128) as a from B001C005 where B0128='02' union ALL 
select count (B0128) as a from B001C006 where B0128='02' union ALL 
select count (A0107) as a from A001A001 where A0107='02') as b;); sb.Replace("aaaaa", "rzCount.Rows[0][0].ToString() );SQL语句执行成功,显示结果为1,但是前台显示结果却不是1而是0,不知到什么原因?求解
谢谢!