mysql date of min, max
Posted
#1
(In Topic #1104)
Regular

How can I find the date of MAX(Temperature) and the date of MIN(Temperature)?
My table looks like this:-
EpochDate as String
ReadingDate as Date
Temperature as Float
Pressure as Float
Posted
Regular

"EpochDate",
'max' as ind
FROM yourtable
WHERE temperature = (Select Min("Temperature") from yourtable)
UNION
SELECT
"EpochDate",
'min' as ind
FROM youtable
WHERE temperature = (Select Max("Temperature") from yourtable);
(or whatever the equivalent SQL is in that g-awful rdbms is).
You should get the jist anyway.
Posted
Regular

However, there would be a problem because there could easily be several maximum temperatures with completely different dates.
I need to re-think this.
Thanks again
1 guest and 0 members have just viewed this.



