sql - MySQL: Select corresponding row for maximum value grouped by date -
i have table hourly temperatures:
id timestamp temperature
i want select highest temperature , corresponding timestamp each day.
select max(temperature), timestamp table group date(from_unixtime(timestamp))
does not work because returns timestamp of first row (but need timestamp row highest temperature).
any suggestions appreciated.
try one....
select max(temperature), timestamp temp group unix_timestamp(date(timestamp));
Comments
Post a Comment