Ошибка БД

Error Number: 1064

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 '' at line 4

select teamid,count(distinct tourid) as tours,count(matchid) as played_games,sum(win + winover + winbullit) as won_games,sum(loss + lossover + lossbullit) as loss_games,sum as won_loss_sets,sum(points) as points from dict_standingreal where leagueid = 179 group by teamid order by