>From 
http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#oper
ator_like:

Note

Because MySQL uses C escape syntax in strings (for example, ³\n² to
represent a newline character), you must double any ³\² that you use in LIKE
strings. For example, to search for ³\n², specify it as ³\\n². To search for
³\², specify it as ³\\\\²; this is because the backslashes are stripped once
by the parser and again when the pattern match is made, leaving a single
backslash to be matched against. (Exception: At the end of the pattern
string, backslash can be specified as ³\\². At the end of the string,
backslash stands for itself because there is nothing following to escape.)



On 2/4/09 10:49 AM, "Yariv Omer" <yar...@jungo.com> wrote:

> Hi
> 
> i have one row in the cpe_id column of the cpe_users table in my
> database with the value: "d\d".
> 
> when i am doing:select cpe_id from cpe_users where cpe_id = 'd\\d' >> I
> got the one result.
> when i am doing:select cpe_id from cpe_users where cpe_id like 'd\\d' >>
> I don't get any result!
> why?
> 
> also when i am doing: when i am doing:select cpe_id from cpe_users where
> cpe_id = 'd\\\\d' >> I do get the one result
> why?
> 
> Thanks, Yariv
> 





-------------------------
Olaf Stein
DBA
Battelle Center for Mathematical Medicine
Nationwide Children's Hospital, The Research Institute
700 Children's Drive
43205 Columbus, OH
phone: 1-614-355-5685
cell: 1-614-843-0432
email: olaf.st...@nationwidechildrens.org


³I consider that the golden rule requires that if I like a program I must
share it with other people who like it.²
Richard M. Stallman

----------------------------------------- Confidentiality Notice:
The following mail message, including any attachments, is for the
sole use of the intended recipient(s) and may contain confidential
and privileged information. The recipient is responsible to
maintain the confidentiality of this information and to use the
information only for authorized purposes. If you are not the
intended recipient (or authorized to receive information for the
intended recipient), you are hereby notified that any review, use,
disclosure, distribution, copying, printing, or action taken in
reliance on the contents of this e-mail is strictly prohibited. If
you have received this communication in error, please notify us
immediately by reply e-mail and destroy all copies of the original
message. Thank you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to