Kornelius777
Neuer Benutzer
- Beiträge
- 4
Hallo Leute,
ich verzweifle gerade mit MIN() und MAX().
Meine Tabelle sieht so aus:
Wenn ich jetzt aber abfrage:
Dann bekomme ich raus:
Was mache ich denn falsch?
Hat jemand einen Tipp?
Danke Euch!
Grüße!
Kornelius
ich verzweifle gerade mit MIN() und MAX().
Meine Tabelle sieht so aus:
Code:
+---------------------+------------+---------+------------+---------+-------+------+
| TIMESTAMP | DEVICE | TYPE | EVENT | READING | VALUE | UNIT |
+---------------------+------------+---------+------------+---------+-------+------+
| 2019-04-27 00:09:41 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 00:44:48 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 01:44:59 | OUT.Wetter | WEATHER | temp_c: 6 | temp_c | 6 | |
| 2019-04-27 02:45:11 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 03:30:34 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 03:40:36 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 04:40:43 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 07:21:14 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 07:41:17 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 08:31:27 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 10:41:52 | OUT.Wetter | WEATHER | temp_c: 9 | temp_c | 9 | |
| 2019-04-27 11:27:00 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 11:42:03 | OUT.Wetter | WEATHER | temp_c: 9 | temp_c | 9 | |
| 2019-04-27 12:42:15 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 13:17:21 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 13:42:26 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 14:37:37 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 15:07:43 | OUT.Wetter | WEATHER | temp_c: 9 | temp_c | 9 | |
| 2019-04-27 16:38:00 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 16:43:01 | OUT.Wetter | WEATHER | temp_c: 10 | temp_c | 10 | |
| 2019-04-27 17:43:12 | OUT.Wetter | WEATHER | temp_c: 9 | temp_c | 9 | |
| 2019-04-27 19:33:33 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 19:38:34 | OUT.Wetter | WEATHER | temp_c: 9 | temp_c | 9 | |
| 2019-04-27 19:43:35 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 20:43:47 | OUT.Wetter | WEATHER | temp_c: 9 | temp_c | 9 | |
| 2019-04-27 20:53:49 | OUT.Wetter | WEATHER | temp_c: 8 | temp_c | 8 | |
| 2019-04-27 21:43:58 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 22:14:04 | OUT.Wetter | WEATHER | temp_c: 6 | temp_c | 6 | |
| 2019-04-27 22:44:10 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
| 2019-04-27 23:04:14 | OUT.Wetter | WEATHER | temp_c: 6 | temp_c | 6 | |
| 2019-04-27 23:44:21 | OUT.Wetter | WEATHER | temp_c: 7 | temp_c | 7 | |
+---------------------+------------+---------+------------+---------+-------+------+
Wenn ich jetzt aber abfrage:
Code:
SELECT MIN(VALUE),MAX(VALUE) FROM `history` WHERE `TIMESTAMP` LIKE '%2019-04-27 %:%:%%' AND `READING`='temp_c' ;
Dann bekomme ich raus:
Code:
+------------+------------+
| MIN(VALUE) | MAX(VALUE) |
+------------+------------+
| 10 | 9 |
+------------+------------+
Was mache ich denn falsch?
Hat jemand einen Tipp?
Danke Euch!
Grüße!
Kornelius