Achso, nochwas:
ich hab in einer Testtabelle mal einfach folgendes gemacht:
SELECT test.val, altertest.x, altertest.y
FROM test
JOIN test AS altertest ON (test.x
BETWEEN altertest.x
AND altertest.x +2)
AND (test.y BETWEEN altertest.y AND altertest.y +2)
GROUP BY test.val;
URSPRUNGSTABELLE ERGEBNISMASSE
+-----+-----+-----+ +-----+-----+-----+
| x | y | val | | val | x | y |
+-----+-----+-----+ +-----+-----+-----+
| 0 | 130 | A | | A | 0 | 130 |
| 10 | 125 | B | | B | 10 | 125 |
| 20 | 120 | C | | C | 20 | 120 |
| 30 | 115 | D | | D | 30 | 115 |
| 40 | 110 | E | | E | 40 | 110 |
| 50 | 105 | F | | F | 50 | 105 |
| 60 | 100 | G | | G | 60 | 100 |
| 70 | 95 | H | | H | 70 | 95 |
| 80 | 90 | I | | I | 80 | 90 |
| 90 | 85 | J | | J | 90 | 85 |
| 100 | 80 | K | | K | 100 | 80 |
| 119 | 69 | L | | L | 119 | 69 |
| 120 | 70 | M | | M | 119 | 69 |
| 121 | 71 | N | | N | 119 | 69 |
| 122 | 90 | O | | O | 122 | 90 |
| 150 | 55 | P | | P | 150 | 55 |
| 160 | 50 | Q | | Q | 160 | 50 |
| 170 | 45 | R | | R | 170 | 45 |
| 180 | 40 | S | | S | 180 | 40 |
| 190 | 35 | T | | T | 190 | 35 |
| 200 | 30 | U | | U | 200 | 30 |
| 210 | 25 | V | | V | 210 | 25 |
| 220 | 20 | W | | W | 220 | 20 |
| 230 | 15 | X | | X | 230 | 15 |
| 240 | 10 | Y | | Y | 240 | 10 |
| 250 | 5 | Z | | Z | 250 | 5 |
+-----+-----+-----+ +-----+-----+-----+
guckst du bei den manipulierten einträgen L,M und N ist zu sehen, dass das Ganze fein zusammengefasst wird.
Gruß, der Hilker