Hallo,
ich hab ein problem bei einer MySQL-Abfrage. Bisher sieht meine abfrage so aus:
select distinct abstimmung,count(*) as anzahl from abstimmung group by abstimmung order by anzahl DESC
Jetzt würd ich aber noch gerne ein weiteres Feld in das Distinct einbeziehen. Also sowohl das Feld abstimmung als auch noch weiteres Feld namens ident.
Ich möchte, dass nur eine Abstimmung pro Ident gezählt wird.
Wie kombiniere ich denn sowas?
select distinct abstimmung,count(*) as anzahl from abstimmung group by abstimmung,ident order by anzahl DESC
wirft für mich nicht nachvollziehbare Ergebnisse nach sich.
Gruß,
Knud