SELECT
*,
count(commentstomedicalfacilities.idCommentsToMedicalFacilities) AS count_comments,
CASE WHEN Count IS NULL THEN 0 END AS CountLikes
FROM
medicalfacilities
aleft outer join
`likes`
ON
likes.IdNote = a.idMedicalFacilities
left outer join
commentstomedicalfacilities
ON
commentstomedicalfacilities.CommentsToMedicalFacilitiesIdMedical = a.idMedicalFacilities
AND
likes.LikeType = 1
WHERE
a.MedicalFacilitiesName LIKE '%com%'
GROUP BY
a.idMedicalFacilities
Выдает ошибку вида:
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 'outer join
likes
ON likes.IdNote = a.idMedicalFacilities left outer join comme' at line 1
Не могу понять, почему ругается