Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mbo's avatar
Level 3

Replace value directly in mysql database

good day,

I'm trying to replace something directly in my mysql database (5.7.28)

Using the following code:

SELECT latitude
FROM postcodes
REPLACE (latitude,',','.')

it gives a error. But i don't understand.

ou have an error in your SQL syntax; 

Thanks for the help1

0 likes
2 replies
MartinFolkerts's avatar

Hi using replace in a select query is something like:

SELECT REPLACE("SQL Tutorial", "SQL", "HTML");

A update query might look something like:

update postcodes set latitude = replace(latitude, ',', '.' )
mbo's avatar
Level 3

thanks for the reply. In this case "sql tutorial" is fixed. How do you deal with 50.000 rows where each time the value wherein you want to replace something changes?

In this example: colom latitude?

thanks for the reaction

Please or to participate in this conversation.