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 'Сосенка"" GROUP BY up.user_id ORDER BY 1 DESC' 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 up.user_id = u.user_id AND
wr.work_user_id = u.user_id AND u.groups = 7 AND up.scholl_place = "МБДОУ Детский сад №96 "Сосенка"" GROUP BY up.user_id ORDER BY 1 DESC