Connecting Tech Pros Worldwide Forums | Help | Site Map

set number of decimal in avg() query

Newbie
 
Join Date: Jul 2008
Posts: 24
#1: Jul 15 '09
how to set the number of decimal when using AVG() query??
for example

select avg(temp) from people group by age;

the result : 23,13214134

i wanna make it into : 23,13

any suggestion??

thx in advance

Newbie
 
Join Date: Jul 2008
Posts: 24
#2: Jul 15 '09

re: set number of decimal in avg() query


i figured it out already ^^
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#3: Jul 16 '09

re: set number of decimal in avg() query


Good to hear that you found a solution. It would be great if you can post the solution in this thread so that it wil be helpful for other users who face similar problem.
Newbie
 
Join Date: Jul 2008
Posts: 24
#4: Jul 17 '09

re: set number of decimal in avg() query


Owh ye, sorry

Just add the round() in ur query

==> select round(avg(temp),x) from people group by age;

'x' is the number of decimal . Hope usefull

Regards
Reply