On Wed, Apr 16, 2014 at 08:52:33PM +0100, steve-ALUG@hst.me.uk wrote:
On 15/04/14 16:37, Mark Rogers wrote:
I don't know what sqlite is capable of and this isn't tested but I'd be looking at something like: SELECT Year(Date) as Year, MAX(IndoorTemperature) as MaxIndoor, MAX(OutdoorTemperature) as MaxOutdoor FROM MyTable GROUP BY Year(Date)
I'm not sure, it's been a while since I've done SQL, but I think that the above will give the Max Indoor Temperature for the WHOLE TABLE and not just for a particular year, and repeat it once for each year in the table.
E.g. if your data was ID Temp Date 1 10 1/1/2000 2 20 1/1/2001 3 30 1/1/2002
I think SQL like
SELECT Year(Date) as Year, MAX(Temp) as MaxTemp, FROM MyTable GROUP BY Year(Date)
would give
30 2000 30 2001 30 2002
Which is why I did the subquery bit in my attempt!
Yes, I think it probably needs a subquery, I'll persevere. Thanks for the ideas everyone.