是这样,用select做一个查询,但条件是只找出满足某一列(int型)的和小于100的那些行。我是这么写的:select a, sum(b), c from table1 where sum(b) < 100 group by...,但是在mysql下不能执行。不知道我说清楚了没有,谢谢指点。

解决方案 »

  1.   

    select * from (select a,c,sum(b) as b from table1 group by a,c) as table where b<100;注:group by a,c
    a,c应为select后面的除b之外的所有字段
      

  2.   

    >>>>>192168001001(汉族程序员) :按你说的方法好像不行啊!
      

  3.   

    mysql说:select a,c,sum(b)附近有错误
      

  4.   

    group by a,c了吗?
    你select的子段除了 a,c,sum(b)还有别的吗?
      

  5.   

    试一下
    select a, sum(b), c from table1 group by a,c having sum(b) < 100 ;
      

  6.   

    去持樓上的. 也可以用:
    select a, sum(b) b, c from table1 group by a,c having b < 100 ;