List:General Discussion« Previous MessageNext Message »
From:Philip Mather Date:December 8 2006 9:57am
Subject:Re: Number extraction from a string
View as plain text  
Chris,
> On Thursday 07 December 2006 16:34, Ed Reed wrote:
>   
>> Thanks for the quick reply Chris.
>>
>> It's close but it's a little off. Your example also returns all
>> instances that where the letter N exists in another words as well
>>     
>
> SELECT SUBSTRING(value,2) as value_num, value FROM num_test WHERE value 
> like 'N%';
>
> Though this wouldn't work if you had like Night or NIGHT.  Is that going to be 
> a choice?
You'll need a regex, see these...
http://dev.mysql.com/doc/refman/4.1/en/pattern-matching.html
http://dev.mysql.com/doc/refman/4.1/en/string-comparison-functions.html
http://dev.mysql.com/doc/refman/4.1/en/regexp.html
Thread
Number extraction from a stringEd Reed7 Dec
  • Re: Number extraction from a stringChris White8 Dec
Re: Number extraction from a stringEd Reed8 Dec
  • Re: Number extraction from a stringChris White8 Dec
    • Re: Number extraction from a stringPhilip Mather8 Dec
      • Re: Number extraction from a stringChris White8 Dec
        • Re: Number extraction from a stringEd Reed8 Dec