我想只查询出 sum(sl)不等于0的记录,该怎样写呢?下面的写法报错了
select name sum(sl) from test where sum(sl)<>0 group by name
------解决方案--------------------
select name , sum(sl)
from test group by name
having sum(sl)<>0
------解决方案--------------------
select name,sum(sl) from test group by name having sum(sl)!=0