So for wettest month in a year I'd use something llike:bigmac wrote:I have reached another stumbling block in the wettest & driest months as well as the hottest and coolest months, as these clearly need to have a lot more data compared to work out which is the correct answer.
Code: Select all
SELECT month( LogDate ) AS MONTH ,
sum( TotRainFall ) AS total
FROM `daydata`
WHERE year( LogDate ) = 2012
GROUP BY month( LogDate )
ORDER BY total DESC
LIMIT 1Code: Select all
SELECT year, month, total
FROM (
SELECT year( LogDate ) AS year, month( LogDate ) AS month, sum( TotRainFall ) AS total
FROM `daydata`
GROUP BY year, month
ORDER BY total DESC
) AS tmp
GROUP BY year