我用这样的语句进行汇总,为什么总计那一行不显示出来,
但是我将两个语句分开来执行的话又没有问题?为什么?select wxdh as 收费号, wxsf as 收费金额
from wxjlb where --sfwxcg='T'and
wxsf is not null and sjwcr>='2002-02-01' and sjwcr <= '2003-08-01'
union
select '总计' as 收费号,SUM(wxsf) as 收费金额 From wxjlb where sfwxcg='T' and wxsf is not null and sjwcr>= '2002-02-01 '
and sjwcr<='2003-08-01'
但是我将两个语句分开来执行的话又没有问题?为什么?select wxdh as 收费号, wxsf as 收费金额
from wxjlb where --sfwxcg='T'and
wxsf is not null and sjwcr>='2002-02-01' and sjwcr <= '2003-08-01'
union
select '总计' as 收费号,SUM(wxsf) as 收费金额 From wxjlb where sfwxcg='T' and wxsf is not null and sjwcr>= '2002-02-01 '
and sjwcr<='2003-08-01'
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货