Home > OS >  #1064 syntax mysql error with " symbol
#1064 syntax mysql error with " symbol

Time:02-04

I need to remove all " symbols in name column

UPDATE oc_product_description SET name = REPLACE(name, """, "");

When I try to simulate this query I get this syntax error:

#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 '"&quot)' at line 1

CodePudding user response:

It works fine here:

CREATE TABLE oc_product_description  (
`name` varchar(50) 
                                   ) ;
INSERT INTO oc_product_description values
('some random text "'),
('some  text "'),
('some  text');


UPDATE oc_product_description SET name = REPLACE(name, '"', ''); 

Demo

CodePudding user response:

UPDATE oc_product_description SET 
name = REPLACE(name, '"', '');
  •  Tags:  
  • Related