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
907
April 18, 2020 08:37PM
421
April 18, 2020 09:14PM
404
April 19, 2020 12:27AM
Re: LIKE not working as expected
420
April 19, 2020 10:38AM
482
April 23, 2020 07:13PM
403
April 27, 2020 08:13AM
357
April 27, 2020 11:02AM
402
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.