tags:

views:

31

answers:

2

Is there a lazy way I can quickly replace all instances of a word with an other, purely in MySQL?

UPDATE sports SET matchup = .....

for example replace Manchester United with Man Utd and Wolverhampton Wanderers with Wolves

A: 

Try:

UPDATE table SET column = "new_value" WHERE column = "old_value"

Which becomes:

UPDATE sports SET name = "Man Utd" WHERE name = "Manchester United"
Toby Hede
the problem was that the name is only a part of the old cell
Moak
+1  A: 

Use the REPLACE command:

UPDATE SPORTS
   SET matchup = REPLACE(matchup, 'Manchester United', 'Man Utd')
OMG Ponies