den Durchschnitt für Value pro Country bekommst Du mit
SELECT DISTINCTROW table.Name, Avg(table.value) AS
[Durchschnitt]
FROM table
GROUP BY table.Name;
Super, das hat geklappt, jetzt sollte ich nochmals eine WHERE-Clause einbauen und zwar, WHERE table.descriptionkat NOT LIKE ‚1%‘ OR table.descriptionkat NOT LIKE ‚6%‘, aber, da bekommt ich FEHLER: GROUP BY clause, wrong!
Wahrscheinlich so nicht, denn so würde es funktionieren:
SELECT table.Name, Avg(table.value) AS [Durchschnitt]
FROM table
WHERE table.descriptionkat NOT LIKE '1%'
OR table.descriptionkat NOT LIKE '6%'
GROUP BY table.Name;
Und Du bist sicher, daß Du hier ein ODER willst? Ich glaube eher, Du willst hier eine UND-Verknüpfung …
WHERE table.descriptionkat NOT LIKE '1%'
AND table.descriptionkat NOT LIKE '6%')
oder
WHERE NOT (table.descriptionkat LIKE '1%'
OR table.descriptionkat LIKE '6%')
Ich hatte die Where-Clause genau, da wo du sie hast, jedoch kam bei mir die Fehlermeldung… kA, was da los war. seltsam!
Wahrscheinlich so nicht, denn so würde es funktionieren:
SELECT table.Name, Avg(table.value) AS [Durchschnitt]
FROM table
WHERE table.descriptionkat NOT LIKE ‚1%‘
OR table.descriptionkat NOT LIKE ‚6%‘
GROUP BY table.Name;
Diese Statement hat einwandfrei geklappt, danke dir.
Und Du bist sicher, daß Du hier ein ODER willst? Ich glaube
eher, Du willst hier eine UND-Verknüpfung …