好像是:group by 后不加where条件。group和where只能取其一。

解决方案 »

  1.   

    应该是:
    select a,sum(f) 
    from c 
    where e>=:e and e<=:e1
    group by a
    先写where 语句,再写group
    (:别忘了给我加分哦!) 
      

  2.   

    那要对符合条件的进行求和,应该什么办呢?
    select 语句中有sum时,提示一定要有group by啊.
      

  3.   

    很简单。
    和我上面写的基本相同,但是因为你如果不用group by,则表明你不用分组求和。
    所以在select 后面的字段中,除了有sum()的字段外,不要有其他的字段即可。
    如:
    select sum(field1),sum(field2),sum(field3)..... 
    from c 
    where e>=:e and e<=:e1
    祝你成功!