Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 135
  • Last Modified:

wordpress - sql query - comments table - replace mutiple words

On wordpress 3.8

on comments table

What sql query will replace
word1 with word2  
word3 with word4
.
.
word99 with word100



P.S.

I have 10 questions, highest point level - open about sql queries

Soo, Lots of points for an sql guy
0
Matt_Walker01
Asked:
Matt_Walker01
1 Solution
 
ZberteocCommented:
You can use nested REPLACE functions:
UPDATE your_table SET 
	your_field = REPLACE(...REPLACE(your_field, 'word1', 'word2'), 'word3', 'word4'),...'word99','word100')
WHERE <condition_here>

Open in new window

0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now