Hello,
I try to develop a query to match wildcards following the LIKE
guidline in the MySQL manual
(http://dev.mysql.com/doc/mysql/en/pattern-matching.html)
Who can help me solve the matching problem? The string I am looking
for consists of 2 charachters a capital B folowed by one digit not
neccesarilly at the beginning of the record.
However it does not return results when it should in my opinion do so.
See the following sample:
SELECT firstname
FROM `patient`
WHERE firstname LIKE '%B[0-9]%' LIMIT 10
returns:
nothing
SELECT firstname
FROM `patient`
WHERE firstname LIKE '%B_[0-9]%' LIMIT 10
returns:
nothing
SELECT firstname
FROM `patient`
WHERE firstname LIKE '%B[0-9]_%' LIMIT 10
returns:
nothing
whereas the following statement
SELECT firstname
FROM `patient`
WHERE firstname LIKE '%B%' LIMIT 10
returns:
+-------------------+
| firstname |
+-------------------+
| B1O1V2 LM |
| B102v3ap |
| B. |
| B. |
| HUBERTINA |
| Tobben |
| B1O1V2 LI LAT LOK |
| B1o1v2 Lm |
| Boost |
| B1o1v1 Ml |
+-------------------+
What am I doing wrong? Or is this only supported by MySQL version 4.1
and up or something like that? I'm running MySQL version 4.0.22-nt-max
on a MS Windows 2000 server environment.
Thanks!
Jonathan