Leser: 12
1
2
3
4
5
6
7
8
9
10
11
12
13
SELECT UNIX_TIMESTAMP(l.TimeDate) time
, AVG(l.intemp)
, AVG(n.intemp)
, DATE_FORMAT(l.TimeDate, '%Y-%m-%d-%H') dates
FROM values.temps l
LEFT
JOIN values.net n
ON DATE_FORMAT(l.TimeDate, '%Y-%m-%d-%H') = DATE_FORMAT(n.TimeDate, '%Y-%m-%d-%H')
WHERE YEARWEEK('2017-01-17 00:00:00',1) = YEARWEEK(l.TimeDate,1)
GROUP
BY dates
ORDER
BY dates ASC
1
2
3
4
5
6
7
CREATE TABLE `temps` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`TimeDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`in` float NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4599 DEFAULT CHARSET=utf8
ON n.TimeDate BETWEEN l.TimeDate - INTERVAL 1 HOUR AND l.TimeDate + INTERVAL 1 HOUR
2017-01-26T14:41:17 kamiOkay das habe ich verstanden. Ich bin aber gerade irgendwie "betriebsblind" wie würdet ihr das denn machen?
Gruß kami