MYSQL - Mit AVG() und DISTINCT zusammen

Wie können Sie das folgende schreiben in MYSQL?

SELECT AVG(col1) FROM table WHERE DISTINCT col2

mehr info:

table

col1 | col2
-----------
2    | 555.555.555.555
5    | 555.555.555.555
4    | 444.444.444.444

liefert '3'

Grundsätzlich bin ich versucht zu wählen Durchschnittliche Wert von col1, wo ip-Adressen in col2 sind verschiedene.

InformationsquelleAutor tim | 2010-02-27

Schreibe einen Kommentar