SELECT MAX(CH1) FROM table where date < '2017-07-15' AND date > 2017-07-16';
For minimum use MIN instead of MAX. This could help you for each columns step by step.
Something like this ?
SELECT MIN(CH1), MAX(CH1), MIN(CH2), MAX(CH2) FROM TABLE
WHERE
Date >= DATE_SUB(CURDATE(), INTERVAL 7 + WEEKDAY(CURDATE()) DAY)
AND
Date < DATE_SUB(CURDATE(), INTERVAL 2 + WEEKDAY(CURDATE()) DAY);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.