Hi Roger,
2003年 8月 14日 木曜日 19:33、Roger Baklund さんは書きました: > * Nils Valentin > > > I have problems understanding why the below two commands would > > return the same result. > > [...] > > > mysql> select * from sensei where link like > > '/var/www/html/xoops/2003\'s sum'; > > [...] > > > mysql> select * from sensei where last_name like > > '/var/www/html/xoops/2003\\\'s sum'; > > [... > > > Note the three backslashes and the single backsplash (after the 2003) > > > > I understood the first sample looks for ...2003's.... and the > > second one for ...2003\'s..... or am I wrong ? > > They both look for "2003's". Thats what I also thought at first sight, but there seems to be more to it. > > The LIKE operator is a pattern matching operator. The operand is evaluated > twice: first by the parser, and then when the pattern matching is > performed. For your last example, the first evaluation changes "2003\\\'s" > to "2003\'s", and the second evaluation changes "2003\'s" to "2003's". THis example works for the second one , how about the first one in comparison ? Best regards Nils Valentin Tokyo/Japan > > <URL: http://www.mysql.com/doc/en/String_comparison_functions.html > > > -- > Roger -- --- Valentin Nils Internet Technology E-Mail: [EMAIL PROTECTED] URL: http://www.knowd.co.jp Personal URL: http://www.knowd.co.jp/staff/nils -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]