MySQL Forums
Forum List  »  Newbie

Finding min é max values for each day
Posted by: Patrick EGLOFF
Date: November 26, 2017 01:07PM

Hi all, this is my first post here.

I have a table (releves) with a datetime (date) and temperature values (temp_ext) for every hour.

I would like to get the datetime for min and max temperatures for each day.

I found this query but, it gives me for each day the min/max values and date YYYY-MM-DD. I need the datetime for each min / max.

sql="select cast(date as date), min(temp_ext), max(temp_ext) from releves group by 1 order by 1"

2017-05-31 20.01 31.29
2017-06-01 12.60 39.77
2017-06-02 14.37 40.14
2017-06-03 16.21 35.20

Thanks for any help.

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.