你的字段是不是int ,系统转为int了呀~你改:select cast(sum(hits) as decimal)/cast(sum(ab) as decimal) team_average from teamstats
你用的是整型的数据,用下面的试试:select cast(sum(hits) as float)/sum(ab) team_average from teamstats