Replace Mysql does not work

0

When I try to replace all records in a field, it indicates a syntax error which I do not understand, this is the query.

 UPDATE tabla 
 SET campo=REPLACE(campo,'\.','');

And I get two alerts

1 - A new declaration was found but there is no delimiter between this and the previous one. (near the replace)

2 - unexpected token symbol near '.'

    
asked by Jeison Gonzalez 14.02.2018 в 15:04
source

1 answer

0

Try to add what you want to replace in a where

UPDATE tabla SET campo=REPLACE(campo,'\.','') WHERE campo like '%\.%';

    
answered by 14.02.2018 в 17:01