Jeff Snoxell wrote:

Hi,

I've got a varchar field in a mysql table that contains 'N' numbers (each a maximum of 4 digits, not zero padded) separated by spaces when more than 1 number is present.

eg. field content might be any of the following

''
'123 4567 1234 45 3'
'3'
'3 4 6'

I want to select only those records that do not contain a certain number.

Problem I have with using LIKE "%MyNum%" is that obviously this is going to match "3" against "123" which I don't want it to.

Is there something I can use like Perl's "word boundary" pattern match code?
I assume you know Perl, then. You can use ... WHERE field REGEXP regexp ...
which is perl-style regexp. It is very useful.

- Cs.



---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to