抱歉你没有看请我的问题: select id,sum(regcount) as totalcount from mytest group by id having totalcount>5这个是没有错的
不好意思,看错了,我用postgresql,你那个语句执行不了 你那个mysql版本可能不支持嵌套查询 select count(*) from (select id,sum(regcount) from mytest group by id having sum(regcount)>5) as a; 这个语句在postgresql里可以执行
select id,sum(regcount) as totalcount from mytest group by id having totalcount>5这个是没有错的
你那个mysql版本可能不支持嵌套查询
select count(*) from (select id,sum(regcount) from mytest group by id having sum(regcount)>5) as a; 这个语句在postgresql里可以执行