I have been tasked with creating a SQL query (limited knowledge) that will show my max temperature and minimum temperature during the day. The information in the db has timestamps every 20 seconds with the point values. I’d like to just see the max temperature for each day.
I know how to do the MAX and Min:
SELECT
MIN (pv) As MinimumTemperature
FROM
plexxium201.dbo.pv_history
SELECT
MAX (pv)
FROM
plexxium201.dbo.pv_history
I’m just having problems with the date, since there are entries every 20 seconds for a day. Any help would be appreciated.
There is also a way to do this with windowing — but I think this will serve your needs.