一个聚合函数的问题
SELECT c.MaterId, sum(Amount) a, k.amt FROM cg_detail as c
left join kf_stock as k on k.MaterId=c.MaterId
group by c.MaterId,k.amt
order by c.MaterId
我现在想把sum(Amount)这列和k.amt不相等的查出来where 语句该怎么写 SQL
[解决办法]
...group by ...
having sum(Amount)!=k.amt
order by...