SELECT DATE(FROM_UNIXTIME(time)) AS daygroup,
MAX(value) AS max_value,
MIN(value) AS min_value
FROM tbl
WHERE time >= UNIX_TIMESTAMP(CURDATE() - INTERVAL 7 DAY)
GROUP BY daygroup
Dies wird das Minimum und Maximum von value
erhalten für jeden Tag in den letzten 7 Tagen.
Bearbeiten: Aktualisierte Lösung zum Abrufen der Daten der gesamten Zeile:
SELECT a.*
FROM tbl a
INNER JOIN
(
SELECT DATE(FROM_UNIXTIME(time)) AS daygroup,
MAX(value) AS max_value
FROM tbl
WHERE time >= UNIX_TIMESTAMP(CURDATE() - INTERVAL 7 DAY)
GROUP BY daygroup
) b ON DATE(FROM_UNIXTIME(a.time)) = b.daygroup AND a.value = b.max_value