Error on run query : SELECT count(*) AS count, sister_city.country, ref_country.fr_female FROM sister_city INNER JOIN ref_france_city ON sister_city.cityid = ref_france_city.cityid INNER JOIN ref_france_department ON ref_france_city.department_code = ref_france_department.department_code INNER JOIN ref_country ON sister_city.country = ref_country.iso2 INNER JOIN ref_france_region ON ref_france_department.region_code = ref_france_region.region_code WHERE sister_city.country IN () AND ref_france_department.url = 'Manche' GROUP BY sister_city.country ; 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 ') AND ref_france_department.url = 'Manche' GROUP BY sister_city.country' at line 12