0
我有以下SQL查詢:如何在此sql查詢中將小數位數限制爲2?
select u.user_name, sum(r.goals) total_goals, sum(r.goals)/(2 * count(1)) avg_goals
from (select community_id, player1_id id, player1_goals goals
from results union all select community_id, player2_id, player2_goals from results) r
inner join users u on r.id = u.id
where r.community_id = 16 group by r.id, u.user_name
ORDER BY avg_goals DESC
其產生的結果,如 "avg_goals" , "1.2500"
(我只在此列此實例興趣)
如何限制小數位的結果只有2?所以輸出將1.25
而不是1.2500