Hi! I have a Table containig Dates, Distances, and TimeForDistance...
Is there any way to Calculate the average per month velocity using MySQL Statements?
Any Help would really be appreciated!
Hi! I have a Table containig Dates, Distances, and TimeForDistance...
Is there any way to Calculate the average per month velocity using MySQL Statements?
Any Help would really be appreciated!
I think you're looking for something like this:
SELECT
YEAR(my_date) as my_year,
MONTH(my_date) as my_month,
sum(Distance) / sum(TimeForDistance) AS velocity
FROM your_table
GROUP BY my_year, my_month
ORDER BY my_year, my_month