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 'Школа здоровья" №901" GROUP BY up.user_id ORDER BY 1 DESC' at line 6
SELECT IF(sum(rate) IS NULL,0,sum(rate)) as rate, up.*
FROM mp_users u
, mp_users_profiles up
, mp_works_rate wr
WHERE up.user_id = u.user_id AND wr.work_user_id = u.user_id AND u.groups = 9 AND up.scholl_place = "ГОУ СОШ "Школа здоровья" №901" GROUP BY up.user_id ORDER BY 1 DESC