Ich habe versucht, eine Abfrage der Datenbank mit dieser Struktur zu machen: Data Base StructureWie alle Elemente in einer indizierten Tabelle zusammenzufassen
ich diese Abfrage tat:
SELECT partido.acronimoPartido, SUM(votosacta.numVotos) FROM partido, votosacta WHERE votosacta.partido_idpartido=1 AND partido.idpartido=1
Diese Abfrage funktioniert wie ich will, aber zeigt nur die Summe von 'votos' für idpartido = 1
Ich möchte in der Lage sein, sum numVotos von 'votosacta' Tabelle für jedes Mitglied meiner 'Partido' Tabelle indiziert in 'votosacta', aber ich scheine nicht in der Lage um das richtige sintax zu bekommen. habe ich versucht, so etwas wie dieses:
SELECT partido.acronimoPartido, SUM(votosacta.numVotos) FROM partido, votosacta WHERE votosacta.partido_idpartido = partido.idpartido
Sie vermissen eine GROUP BY-Klausel –