I have a mysql table eg:
date name value
01/01/12 a 1.12345
01/01/12 b 1.7893
02/01/12 a 1.13456
02/01/12 b 1.6789
I normally have to calculate to get a derived value for a certain date eg (1 * b.value/a.value)
I am trying to get the average value AVG(value) of derived values for the entire month eg jan 2012.
How can I put this into a single query within my php script?