The only regular expression MySQL support return a true/false if the expression was found. I had to do something similar to what you want to do. Although I needed to count how many digits there were. You can use the REPLACE() function to strip out the numbers. Of course, this means you need to do 10 replaces, 1 for each number.

You can just nest them altogether like so:
SELECT REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE (field, 1, ''), 2, ''), 3, '', 4,'', ... ) AS NoNums

It's ugly, but it will get the job done. If you are post processing the data on the front end, it may be quicker and certainly easier to do it there.


On Jul 26, 2007, at 7:40 AM, Lars Schwarz wrote:

hi all, is there any shorthand to extract the string part of a varchar field
only?
like when having german street addresses (e.g. foostreet 23) in a varchar
field
and i want to select the non-numeric part of it (foostreet) only?

thanks, best: lars


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to