Mam takie zapytanie:
SELECT SUM(pkt) AS points, riders.id,riders.wiek,COUNT(*) AS points FROM points LEFT JOIN riders ON id_zawodnika = riders.id WHERE `mecz`='77' AND points.klub='1' GROUP BY id_zawodnika ORDER BY SUM(pkt) DESC LIMIT 4
I wysietla mi to taki wynik poprawnie:

tylko ze jeszcze chce dodać warunek where ta ostatnia kolumna czyli COUNT jest mniejsza od 6, ale jak dopisuje w zaptaniu AND COUNT(*) AS `points`<'6' To mi wywala bład ;/
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `points`<'6' GROUP BY id_zawodnika ORDER BY SUM(pkt) DESC LIMIT 4' at line 4