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 Throws an error like:
You have an error in your SQL syntax; If you’re on the right line, you’ll find it easy to use it.
I can not understand why swears