LIKE not working as expected
When searching for values containing a backslash, MySQL is not finding the rows as expected. Here's an example:
create table t (c varchar(50)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
insert into t values ('test\\test');
select * from t where c like '%\\\\test' escape '\\';
No rows are returned.
Changing the number of escaped backslashes in the "like" expression doesn't help. This is on MySQL 5.1.73 on RedHat.
Subject
Views
Written By
Posted
LIKE not working as expected
814
April 18, 2020 08:37PM
382
April 18, 2020 09:14PM
364
April 19, 2020 12:27AM
370
April 19, 2020 10:38AM
424
April 23, 2020 07:13PM
362
April 27, 2020 08:13AM
327
April 27, 2020 11:02AM
361
April 27, 2020 12:00PM
Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
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.