my sql query is:
mysql> select emp_id where classes like '%'XII'%';
but i am getting this error:
ERROR 1064 (42000): 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 'where classes like '%'XII'%'' at line 1
I can understand that error is due to single quotes i have used in like arguments but i have string say 'X','XI','XII' in my database. that's why i am querying with single quote because if i query for class X in String 'XI','XII' then it will return emp_id of those who are teaching XI and XII standard which is undesirable.
Can i use escape characters for special characters in like argument.