PDA

View Full Version : SQL Replace Query


turbo2liter
10-15-2010, 12:17 PM
Say I want to replace a single word in every post on the board - the word is within the content of the posts. Can anyone help me with the query to do this?

--------------- Added 1287150596 at 1287150596 ---------------

This?

UPDATE post SET pagetext = replace(pagetext, 'tofind', 'toreplacewith');

borbole
10-15-2010, 02:14 PM
Say I want to replace a single word in every post on the board - the word is within the content of the posts. Can anyone help me with the query to do this?

--------------- Added 1287150596 at 1287150596 ---------------

This?

UPDATE post SET pagetext = replace(pagetext, 'tofind', 'toreplacewith');

That should do it.