【发布时间】:2021-12-13 15:23:37
【问题描述】:
如何选择具有撇号容器的记录?使用相同的词没有撇号?
+----+------------------------------------------+-------+
| id | name | price |
+----+------------------------------------------+-------+
| 1 | World's Best Inspirational Books | 199 |
| 2 | Ben Martin Men's Slim | 98 |
| 3 | Harry Potter and the Philosopher's Stone | 79 |
| 4 | Today's life | 690 |
| 5 | Life's Amazing Secrets | 99 |
+----+------------------------------------------+-------+
$search = "worlds";
SELECT * FROM product WHERE name LIKE "%$search%";
我想从$search = "world's";得到这个结果
+----+------------------------------------+-------+
| id | name | price |
+----+------------------------------------+-------+
| 1 | World's Best Inspirational Books | 199 |
+----+------------------------------------+-------+
但我知道了,Empty set (0.001 sec)
如何使用 `worlds 搜索 world's(撇号) 单词(不包括撇号)?
【问题讨论】:
-
where replace(name, '''', '') like '%worlds%'
-
这里无法复制dbfiddle.uk/…