mysql - Which SQL command should I use to replace specific values? -


i have numeric values below:

0
2323
1003

i have replace only single zeros 100. tried following code affects other values include 0.

update table_name set field_name= replace(field_name,"0","100"); 

the values should below after transaction:

100
2323
1003

which sql command should use?

thanks.

you should use where clause instead of replace.

update table_name set field_name = 100 field_name = 0 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -