MySQL Forums
Forum List  »  Newbie

Re: Finding min é max values for each day
Posted by: Patrick EGLOFF
Date: November 28, 2017 06:56AM

Hi, thanks for answer.

I tried this but i get this error : "Unknown column 'maxs.date' in 'on clause'"


select mm.d, mm.mintemp, time(mins.date) as mintime, mm.maxtemp, time(maxs.date) as maxtime
from (
select date(date) as d, min(temp_ext) as mintemp, max(temp_ext) as maxtemp
from releves
group by d
) mm
join releves as mins on mm.d=date(maxs.date) and mm.mintemp=mins.temp
join releves as maxs on mm.d=date(mins.date) and mm.maxtemp=maxs.temp

Thanks,

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.