求表里的Auto_contractID相同的mMoney的和....
意思是一个表有Auto_contractID字段,还有mMoney字段。,求这个表里的Auto_contractID相同的mMoney的和....
------解决方案--------------------select Auto_contractID,sum(mMoney) as mMoney
from tb
group by Auto_contractID
------解决方案--------------------多谢lz,接分:)
SELECT Auto_contractID,SUM(mMoney) AS mMoney
FROM tb
GROUP BY Auto_contractID
------解决方案--------------------select Auto_contractID, mMoney=sum(mMoney)
from tbName
group by Auto_contractID
------解决方案--------------------接分
------解决方案--------------------select
Auto_contractID,
[mMoney]=sum(mMoney)
from tbName
group by Auto_contractID--加一个组会合并相同的Auto_contractID
------解决方案--------------------晕~~为什么我看帖~总这么慢看到