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" AND up.user_id = u.user_id AND wr.work_us' at line 5
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 u.groups = 8 AND up.scholl_place = "ГОУ СОШ "Школа здоровья" № 901" AND up.user_id = u.user_id AND wr.work_user_id = u.user_id GROUP BY up.user_id ORDER BY 1 DESC