Hur gör jag för att ta ut Antal = 5? Lägg till HAVING count(*) = 5 efter GROUP BY sid
SQL: count(*) = 5, hur?
Svara
SELECT sid, sum(resultat) As Res, count(sid) as Antal
FROM tavlingResultat
WHERE TavlingsID = 7
GROUP BY sid
ORDER BY sum(resultat);
Sv: SQL: count(*) = 5, hur?
Svara
Ex:
SELECT sid, sum(resultat) As Res, count(sid) as Antal
FROM tavlingResultat
WHERE TavlingsID = 7
GROUP BY sid HAVING count(*) = 5
ORDER BY sum(resultat);