1064 - 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 e.id  ORDER BY end_date ASC' at line 48

SELECT e.id, e.start_date, e.end_date, e.start_time, e.end_time, e.recurring, e.recur_dayofweek, e.weekly_recurr_1, e.weekly_recurr_2, e.weekly_recurr_3, e.weekly_recurr_4, e.weekly_recurr_day, e.omit_sat, e.omit_sun, e.day_event, e.cat_id, e.cluster_default_town, e.priority, ed.type_business, ed.type_carboot, ed.type_charity, ed.type_cinema, ed.type_comedy, ed.type_community, ed.type_education, ed.type_exhibition, ed.type_family, ed.type_fashion, ed.type_festival, ed.type_food, ed.type_health, ed.type_market, ed.type_music, ed.type_sport, ed.type_theatre, ed.type_youth, ed.type_nights, ed.title, ed.venue, ed.venue2, ed.intro, ed.content, ed.picture, ed.pic_caption, ed.lat, ed.lng, ed.distance_from_centre, ed.free, ed.business_id, ed.phone, ed.email, ed.file_loc, ed.file_name, ed.contacted, b.trading_name, g.gatename, b.gateway, COUNT(comment_id) AS total_comments FROM ltw_eventsv4 e LEFT JOIN ltw_events_details ed ON e.id=ed.id LEFT JOIN comments ON ed.id=comments.discussion_id LEFT JOIN business b ON ed.business_id = b.business_id LEFT JOIN business_gateway g ON ed.business_id = g.business_id WHERE e.site_name = 'uxbridge' AND e.end_date >= '2020-09-19' AND e.validate = 'y' AND e.id = '151288' LIMIT 1 GROUP BY e.id ORDER BY end_date ASC