error 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 trip.ID' at line 6 ( select count(*) as count from trip_content INNER JOIN trip ON trip.ID = trip_content.trip_ID INNER JOIN tripgroup ON tripgroup.ID = trip.tripgroup_ID WHERE trip_content.trip_structure_ID = 7 AND trip.tripgroup_ID = GROUP BY trip.ID )