SELECT t.theatre_id FROM my_today_theatre_test AS t, my_today_movie_list1 AS m WHERE t.theatre_id = m.theater_name AND t.theatre_name = '' AND city_id = GROUP BY t.theatre_id cannot execute mysql query, the reason is 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 t.theatre_id' at line 1