Greška Vordpresove baze podataka: [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 ')), 0)
score,
IFNULL((SELECT sum(redosled) FROM wp_fsris_oduzimanje_b...' at line 16]
SELECT
team,
clubname,
grb,
count(*) played,
count(case when goalsfor > goalsagainst then 1 end) wins,
count(case when goalsagainst> goalsfor then 1 end) lost,
count(case when goalsfor = goalsagainst then 1 end) draws,
sum(goalsfor) goalsfor,
sum(goalsagainst) goalsagainst,
sum(goalsfor) - sum(goalsagainst) goal_diff,
sum(
case when goalsfor > goalsagainst then 3 else 0 end
+ case when goalsfor = goalsagainst then 1 else 0 end
)+
IFNULL((SELECT sum(points) FROM wp_fsris_oduzimanje_bodova WHERE `club_id`=team AND `round_id` IN ()), 0)
score,
IFNULL((SELECT sum(redosled) FROM wp_fsris_oduzimanje_bodova WHERE `club_id`=team AND `round_id` IN ()), 0)
redosled,
IFNULL((SELECT sum(points) FROM wp_fsris_oduzimanje_bodova WHERE `club_id`=team AND `round_id` IN ()), 0)
oduzeto,
sum(away_scored) away_scored
FROM (
SELECT wp_fsris_matches.home_team team, wp_fsris_matches.home_score goalsfor, wp_fsris_matches.away_score goalsagainst, wp_fsris_clubs.name clubname, wp_fsris_clubs.grb grb, NULL away_scored
FROM wp_fsris_matches
LEFT JOIN wp_fsris_clubs ON wp_fsris_matches.home_team = wp_fsris_clubs.id
WHERE wp_fsris_matches.home_score IS NOT NULL AND wp_fsris_matches.away_score IS NOT NULL AND wp_fsris_matches.round_id IN ()
UNION ALL
SELECT wp_fsris_matches.away_team team, wp_fsris_matches.away_score goalsfor, wp_fsris_matches.home_score goalsagainst, wp_fsris_clubs.name clubname, wp_fsris_clubs.grb grb, wp_fsris_matches.away_score awayscore
FROM wp_fsris_matches
LEFT JOIN wp_fsris_clubs ON wp_fsris_matches.away_team = wp_fsris_clubs.id
WHERE wp_fsris_matches.home_score IS NOT NULL AND wp_fsris_matches.away_score IS NOT NULL AND wp_fsris_matches.round_id IN ()
) a
GROUP BY team
ORDER BY score desc, redosled desc, goal_diff desc, goalsfor desc, away_scored desc, clubname asc;