MySQL – Average Values in a Column

You can pull the average of the numeric values in a column with SQL in MySQL.

avg()

Select avg(temp) from temp;

Select avg(temp) from temp where macAddress=‘60bbbaa4ae30’

Select avg(temp) from temp where macAddress=‘60bbbaa4ae30’ and timestamp > 1158013757

Select macAddress, avg(temp) from temp group by macAddress

Be the first to comment

Leave a Reply