0
UPDATE table_name SET name='rom' WHERE Country='ra'm'

I have old data with quote on it and i cannot use WHERE clause because of it. How can I use WHERE clause on it even by escape it considers as different. like ra'm is not equal to ra\'m.

user2986104
  • 111
  • 7

1 Answers1

0

Try using double quotes instead.

UPDATE table_name SET name='rom' WHERE Country="ra'm"

Grice
  • 1,345
  • 11
  • 24
  • It says 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 'm' WHERE Country="ra'm"' at line 1 – user2986104 Oct 12 '14 at 19:10
  • I got the answer the double quote will work but we have to escape ra'm then it works. Thank you. – user2986104 Oct 12 '14 at 19:14