MySQL Error!
MySQL error in file: /engine/modules/dotaapi/static/team/stat.php at line 146
Error Number: 1064
The Error returned was:
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 'm.id_team1,m.id_team2)) AS team2, MIN(t.name_dle) as team2_name, ' at line 3
SQL query:

SELECT s.match_date, MIN(IF(m.id_team1 <> ,m.id_team1,m.id_team2)) AS team2, MIN(t.name_dle) as team2_name, MIN(t.url_dle) as team2_url, COUNT(m.id_match) as matchs_num, COUNT(CASE WHEN (m.id_team1 = AND m.f10score1 = 10) OR (m.id_team2 = AND m.f10score2 = 10) THEN 1 END) AS f10_num FROM dle_dotaapi_matchs as m, dle_dotaapi_series as s, dle_dotaapi_active_teams as t WHERE m.id_series = s.id_series AND IF(m.id_team1 <> ,m.id_team1,m.id_team2) = t.id_team AND (m.id_team1 = OR m.id_team2 = ) GROUP BY s.id_series ORDER BY s.match_date DESC, s.id_series DESC LIMIT 12;