select count(*) 数目
from
(
select mobile,count(*)as count,sum(Sumfee)as total from Tab1
where calltime between '2003-11-1' and '2003-12-1'
group by mobile
having sum(Sumfee)>500
) a

解决方案 »

  1.   

    to gmlxf(烛光)
    不能运行啊!提示"没有为第 1 列(属于 'a')指定列。"
    什么意思啊?
    我头脑昏了:(
      

  2.   

    gmlxf(烛光)的,可以的!你际实查询中类似count(*) as [count] 另生成的都要用AS有列名,就行了
      

  3.   

    gmlxf(烛光) 的少了个空隔,应该如下:
    select count(*) 数目
    from
    (
    select mobile,count(*) as count,sum(Sumfee) as total from Tab1
    where calltime between '2003-11-1' and '2003-12-1'
    group by mobile
    having sum(Sumfee)>500
    ) a
      

  4.   

    select count(*) 数目
    from
    (
    select mobile,count(*)as count,sum(Sumfee)as total from Tab1
    where calltime between '2003-11-1' and '2003-12-1'
    group by mobile
    having sum(Sumfee)>500
    ) a