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 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 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
Archived
This topic is now archived and is closed to further replies.