select pub ,sum(price) from books group by pubselect 前面有的 group by 后面一定要有where sum(price)>10 错聚集函数是不能作为where条件的可以用havingselect pub ,sum(price) from books group by pub having sum(price)>10;聚合函数 不能再where条件还有 selecte 要显示的列 后面 group 不要一定要有