Vakka Tour 2020 CTP-kisa

Tourin pistetilanne.

CTP-kisan pistetilanne:

WordPressin tietokantavirhe: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') group by userid having Pisteet > 0) as cp on cp.userid = c.userid where c.c...' at line 1]
SELECT c.userID, userName, name,ck.hole,result, points,Pisteet, resCount FROM `CTP` as c join CTPkisat as ck on c.compid = ck.compid and points > 0 join (SELECT userid, sum(points) as Pisteet, count(*) as resCount FROM `CTP` where status = 'New' and points > 0 and compID in (select skoorinID from wdgm_vakkatour_kisat where year = ) group by userid having Pisteet > 0) as cp on cp.userid = c.userid where c.compID in (select skoorinID from wdgm_vakkatour_kisat where year = ) order by Pisteet desc,c.userid, date desc

SijoitusNimiKisaVäyläTulosPisteetTotal