MySQL Forums
Forum List  »  Newbie

Re: like with backslash
Posted by: Paul McArdle
Date: June 30, 2005 06:02AM

'\' is the escape character
From http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html
Note: Because MySQL uses the C escape syntax in strings (for example, '\n' to represent newline), you must double any '\' that you use in your LIKE strings. For example, to search for '\n', specify it as '\\n'. To search for '\', specify it as '\\\\' (the backslashes are stripped once by the parser and another time when the pattern match is done, leaving a single backslash to be matched).
see

you need select * from test.junk where s like "%c\\\\foobar.java"

Options: ReplyQuote


Subject
Written By
Posted
June 29, 2005 08:45PM
Re: like with backslash
June 30, 2005 06:02AM
June 30, 2005 01:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.