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 rezo.rc_gender.id In (1,2,3,7,8,9,10) Group by rezo.s' at line 31