How can I get values from mysql ten by ten days? The structure of the table is like this:
date tmax tmin rain
1960-01-01 25.5 23.1 12.0
1960-01-02 24.3 22.5 0.0
...
1960-02-01 ...
...
1960-03-01 ...
...
1961-01-01 26.4 21.4 10.3
1961-01-02 ...
...
The data are arranged day by day, as you can see. I can get those values year by year and, for each year, month by month, with the following code.
Code: Select all
<?php
$result_temp = mysql_query( "SELECT AVG(( tmax + tmin ) / 2 )
AS temp_avg FROM dados
GROUP BY YEAR( data ), MONTH( data )" );
?>Any help or suggestion I'd appreciate.
Regards,
rwar.