I have been attempting to update a column based on a group by a select from one table into another table. The below subquery on the set statement works but only for one date because if I use a date range I get an error of "subquery returns more than 1 row".
I instead want to run that on a date range fetching the group by for each day (from "Monthly" table) inserting each matching row by day into "Dayfile" table. The dayfile table has a row for each date with the "LogDate column" as date and the monthly table is a log file of minute-by minute values where the "LogDateTime" data type is datetime.
UPDATE
Dayfile
SET
MaxFeelsLike =
(SELECT MAX(FeelsLike)
FROM Monthly, Dayfile
WHERE DATE(LogDateTime) = "2018-10-04"
AND DATE(LogDateTime) = DATE(LogDate)
GROUP BY DATE(LogDateTime)
);