MySQL Forums
Forum List  »  InnoDB

Re: LIKE not working as expected
Posted by: Peter Brawley
Date: April 19, 2020 10:38AM

To show no backslashes, insert 1, to show 1 insert 2, to show 2 insert 4, &c ...

select version(), @@sql_mode;
+-----------+--------------------------------------------+
| version() | @@sql_mode                                 |
+-----------+--------------------------------------------+
| 8.0.19    | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+-----------+--------------------------------------------+
drop table if exists data;
create table data( stringvalue varchar(32) );
insert into data set stringvalue="Thor\'s Hammer";
insert into data set stringvalue="Thor\\'s Hammer";
select * from data;
+----------------+
| stringvalue    |
+----------------+
| Thor's Hammer  |
| Thor\'s Hammer |
+----------------+
select * from data WHERE stringValue = "Thor\'s Hammer";
+---------------+
| stringvalue   |
+---------------+
| Thor's Hammer |
+---------------+
select * from data WHERE stringValue = "Thor\\'s Hammer";
+----------------+
| stringvalue    |
+----------------+
| Thor\'s Hammer |
+----------------+

Options: ReplyQuote


Subject
Views
Written By
Posted
785
April 18, 2020 08:37PM
372
April 18, 2020 09:14PM
Re: LIKE not working as expected
360
April 19, 2020 10:38AM
353
April 27, 2020 08:13AM


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.