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 ') and c.religioncasteName NOT LIKE '%Other%'' at line 1

select r.religioncasteName as religion_name, r.file_name as religion_filename, c.religioncasteName, c.disp_caste_name, c.file_name as caste_file_name from religion_caste_tbl c INNER JOIN religion_caste_tbl r ON c.ref_id=r.slno where c.slno IN () and c.religioncasteName NOT LIKE '%Other%'