0
I have several columns in a csv table, I imported the table into mysql, but when I import into mysql I have to do this import as varchar for all data. If I do a CAST in these columns and then take out the average I think will work out the average value, however, I do not know how to do. Can someone help us? Thank you.
Have you tried to average without doing CAST?
– Sam
I took yes, even worked, because I checked together with Excel, however, there is a person who is quite experienced in mysql and said I would have to cast.
– Jonatã Paulino
Would not be
AVG(CAST(campo as SIGNED))
?– Sam
SELECT name, CAST(AVG(cota_fpm) AS decimal(3,2)) AS cota_fpm FROM dadosv5 GROUP BY name; - Would that be so? Only I have several columns, I have to make for each one is not?
– Jonatã Paulino
Craa, I’m kind of amateur in Mysql, I only know the basics. I don’t know a way to do everything at the same time.
– Sam
All right, I thank you for your help buddy. Let’s wait and see if any of the beasts answer.
– Jonatã Paulino