Forum Moderators: open

Message Too Old, No Replies

Help with Regxp mysql statement

regexp mysql statement

         

8kobe

7:51 pm on Oct 21, 2007 (gmt 0)

10+ Year Member



SELECT * from `book` WHERE BINARY complete_name REGEXP '[A-Z]{2}'

The above will pull out the information that I want. What I would like to do is remove this information from complete_name and replace complete_name with the new version (minus the regexp match) and put the regexp matches into a seperate column called flags.

Things of importance. All flags are 2 characters long and all capitals. There may be multiple flags per a single entry. The table has about 3 million records on it so speed is a must. It doesn't matter if the information is moved into a comma delimited varchar or an enum.