On Friday 08 December 2006 01:57, Philip Mather wrote: > 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
Yes, you could use a regex and it would work, but if the format of N### is persistant and there are no false positives than I'd rather use that instead of regexes, which can an intensive operation. Also you might want to try: SUBSTR(value,2) instead of LIKE 'N%' just to see how they compare. If a regex is required, you could have something like: SELECT SUBSTRING(value,2) as value_num, value FROM num_test WHERE value x; where x is one of the following depending on the situation: REGEX('N[0-9]+$') REGEX('N[0-9]+') REGEX('N[0-9]{3}$') depends on how specific you want to get really. -- Chris White PHP Programmer Interfuel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]