[nSLUG] MySQL find/replace
milesthom at gmail.com
Sat Jun 26 21:50:05 ADT 2010
Did you have a look at IS NULL and isnull() ?
It's a trap I've fallen into before - "NULL" is not a real null, it's a
How about this, untested of course:
update wp_postmeta set meta_key = "my replacement text" where
Cheers - Miles
On Sat, Jun 26, 2010 at 7:14 PM, Herb <htheriault at gmail.com> wrote:
> Hi all,
> I'm migrating an aging drupal site to wordpress and am stuck on one of
> my last sql tasks, involving replacing a field in one of the mysql
> mysql> update wp_postmeta set meta_key = replace(meta_key,"NULL","my
> replacement text");
> Query OK, 0 rows affected (0.00 sec)
> Rows matched: 549 Changed: 0 Warnings: 0
> It's matching the entire column instead of the fields that are NULL
> Attempts at changing the first bracketed field to NULL as well
> ("NULL","NULL","my replacement text") actually fills the column with
> the replacement.
> Can anyone shed some light on what I'm missing?
> nSLUG mailing list
> nSLUG at nslug.ns.ca
"The piano keys are black and white,
But they sound like a million colours in your mind"
Spider's Web - Katie Melua
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nSLUG