简体   繁体   中英

Find and append text in all records of a table in SQL

I have a table called tabTranslations and I need to find all occurrences of a word and change it to something else(whilst preserving any other words in the record). Is this possible without changing every record manually? As this would take me forever.

For example let's say I wanted to find the word "value" in all the records and change it to "values", but there may be a record with the text "some text value" in which case I would want it to then read "some text values".

I only really know the very basics of SQL so I'm unsure if I can do this or how I would go about it.

This query should work.

update tabTranslations 
set columnName = REPLACE(columnName,'value','values')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM