Hallo,
ich bräuchte mal Hilfe bei folgender Tabelle:
id ----- key ----- charid ----- time ----- value
1 ----- 0 ----- 1 ----- timestamp ----- 0.42343452
2 ----- 0 ----- 2 ----- timestamp ----- 0.35434345
3 ----- 0 ----- 3 ----- timestamp ----- 0.23443457
4 ----- 0 ----- 4 ----- timestamp ----- 0.44563544
5 ----- 0 ----- 5 ----- timestamp ----- 0.45623436
6 ----- 14 ----- 1 ----- timestamp ----- 0.42345343
7 ----- 14 ----- 2 ----- timestamp ----- 0.42456543
8 ----- 14 ----- 3 ----- timestamp ----- 0.56756234
9 ----- 14 ----- 4 ----- timestamp ----- 0.34523456
10 ----- 14 ----- 5 ----- timestamp ----- 0.43453234
11 ----- 22 ----- 1 ----- timestamp ----- 0.42343452
12 ----- 22 ----- 2 ----- timestamp ----- 0.35434345
13 ----- 22 ----- 3 ----- timestamp ----- 0.23443457
14 ----- 22 ----- 4 ----- timestamp ----- 0.44563544
15 ----- 22 ----- 5 ----- timestamp ----- 0.45623436
16 ----- 55 ----- 1 ----- timestamp ----- 0.42345343
17 ----- 55 ----- 2 ----- timestamp ----- 0.42456543
18 ----- 55 ----- 3 ----- timestamp ----- 0.56756234
19 ----- 55 ----- 4 ----- timestamp ----- 0.34523456
20 ----- 55 ----- 5 ----- timestamp ----- 0.56756234
21 ----- 0 ----- 1 ----- timestamp ----- 0.56473815
22 ----- 0 ----- 2 ----- timestamp ----- 0.12345678
23 ----- 0 ----- 3 ----- timestamp ----- 0.87654321
…
Das sind die Daten wie sie in einer vorhandenen Tabelle stehen.
und ich brauche sie aber in dieser Form:
charid ----- key ----- value
1 ----- 0 ----- 0.42343452
1 ----- 14 ----- 0.42456543
1 ----- 22 ----- 0.42343452
1 ----- 55 ----- 0.42345343
charid ----- key ----- value
2 ----- 0 ----- 0.35434345
2 ----- 14 ----- 0.42345343
2 ----- 22 ----- 0.35434345
2 ----- 55 ----- 0.42456543
Verbal ausgedrückt wäre das:
Ich brauch zu jedem ‘key’ zu jeder ‘charid’ den ÄLTESTEN ‘value’
(deswegen ist auch ‘time’ mit in der ausgangstabelle aufgeführt).
Danke schonmal vorneweg
