MySQL Forums
Forum List  »  General

Getting max temp values
Posted by: Patrick Simonds
Date: September 12, 2015 11:47AM

A total neophyte to MySQL, but I have created a weather database and I want to be able to pull out the max temp for each day and the last time on that day it occurred. I have created my view and it returns the max temp for each day but does not give me the correct EventTime, mostly returning 00:00:00. Currently the view returns just over 5300 rows in just under 5 seconds.

Any help would be appreciated.


CREATE
ALGORITHM = UNDEFINED
DEFINER = `root`@`localhost`
SQL SECURITY DEFINER
VIEW `view_testtest` AS
SELECT
`weatherhistorical`.`EventDate` AS `EventDate`,
`weatherhistorical`.`EventTime` AS `EventTime`,
MAX(`weatherhistorical`.`TempOut`) AS `TempOut`
FROM
`weatherhistorical`
GROUP BY `weatherhistorical`.`EventDate`

Options: ReplyQuote


Subject
Written By
Posted
Getting max temp values
September 12, 2015 11:47AM
September 13, 2015 07:55PM
September 14, 2015 12:40PM


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.