Re: LIKE not working as expected
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 |
+----------------+
Subject
Views
Written By
Posted
932
April 18, 2020 08:37PM
432
April 18, 2020 09:14PM
424
April 19, 2020 12:27AM
Re: LIKE not working as expected
432
April 19, 2020 10:38AM
500
April 23, 2020 07:13PM
417
April 27, 2020 08:13AM
368
April 27, 2020 11:02AM
414
April 27, 2020 12:00PM
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.