TimUSA Posted February 9, 2008 Share Posted February 9, 2008 I am using this query, how do i limit the decimals on the return for avg() SELECT skipperName, sum( fleetPoints ) AS SumfleetPoints, avg( fleetPoints ) AS rating, count( fleetPoints ) AS races FROM pts_table WHERE fleetPoints >0 GROUP BY skipperName ORDER BY rating DESC , SumfleetPoints, races ASC Quote Link to comment https://forums.phpfreaks.com/topic/90175-solved-decimals-in-a-query/ Share on other sites More sharing options...
p2grace Posted February 9, 2008 Share Posted February 9, 2008 Try this: SELECT skipperName, sum( fleetPoints ) AS SumfleetPoints, truncate(avg( fleetPoints ),2) AS rating, count( fleetPoints ) AS races FROM pts_table WHERE fleetPoints >0 GROUP BY skipperName ORDER BY rating DESC , SumfleetPoints, races ASC Quote Link to comment https://forums.phpfreaks.com/topic/90175-solved-decimals-in-a-query/#findComment-462408 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.