CREATE TABLE test (
id INT(9) ,
my_string varchar(40)
) ;
INSERT INTO test values (1,'test"'),(2,'""test'),(3,"'"),(4,'test"');
select * from test;
update test set my_string= REPLACE(my_string, "'", "&");
select * from test;
update test set my_string= REPLACE(my_string, '"', '@');
select * from test ;
是的,您可以替换
'
and"
。举个例子:在演示中检查结果。
演示:https ://www.db-fiddle.com/f/7yUJcuMJPncBBnrExKbzYz/87