List:General Discussion« Previous MessageNext Message »
From:Phil Date:January 21 2011 7:31pm
Subject:Is is possible to update a column based on a REGEXP on another column?
View as plain text  
I have a table which contains a username column which may be constructed
something like

somename[AAAAA] or [BBBBCCCCDDD]someothername

The AAAAA or BBBBCCCCDDD can be anything at all.

I've added a new column to the table to which I'd like to populate with the
value within the square brackets.

I could write something in perl or php to run through each and update them
but was wondering if there is a way to do this within mysql itself?  The
regexp only returns a boolean so I can't see how to use that.

Regards

Phil


-- 
Distributed Computing stats
http://stats.free-dc.org

Thread
Is is possible to update a column based on a REGEXP on another column?Phil21 Jan
  • Re: Is is possible to update a column based on a REGEXP on another column?Eric Bergen22 Jan
    • Re: Is is possible to update a column based on a REGEXP on another column?Johan De Meersman24 Jan