有一个表(地区,姓名,税款,时间)
要求要得到某地区一个月内的纳税人数,纳税总额.结果如下:
    东西湖区  104  2000.47
    江岸区    200  3021.5
    ......
不知道该怎么写,帮帮我吧!

解决方案 »

  1.   

    Select 地区,count(地区),sum(税款) from 表 
    where 时间>=起始时间 and 时间<=结束时间
    group by 地区
      

  2.   

    select 地区,count(姓名) as 纳税人数,sum(税款) as 纳税总额
    from 你的表 where 时间=?
      

  3.   

    select 地区,count(姓名) as 纳税人数,sum(税款) as 纳税总额
    from 你的表 where 时间=?
    group by 地区
      

  4.   

    select count(姓名) as 人数,sum(税款) as 总额,地区 
    from Table where 时间>=起始时间 and 时间<=结束时间
    Group by 地区
      

  5.   

    select 地区,count(姓名),sum(税款)
    from 表
    where 时间 between 起始时间 and 截止时间
    group by 地区;