gpt4 book ai didi

使用where子句时mysql不获取现有记录

转载 作者:行者123 更新时间:2023-11-29 07:50:44 24 4
gpt4 key购买 nike

我有一个 id 为 780 且 file_name 为 소유22.jpg

的列

但是当我使用 select * FROM Attachments WHERE Attachments.file_name LIKE '%소유%'; 的 where 查询时,Mysql 不会获取我的 id 为 780 且适合查询的记录。

这有什么问题吗?

mysql> select * FROM attachments WHERE id = 780;
+-----+--------------------+---------------------+---------------------+-------------+--------------+--------------------+
| id | image | created_at | updated_at | image_width | image_height | file_name |
+-----+--------------------+---------------------+---------------------+-------------+--------------+--------------------+
| 780 | 소유22.jpg | 2014-10-21 00:58:20 | 2014-10-21 00:58:20 | 518 | 805 | 소유22.jpg |
+-----+--------------------+---------------------+---------------------+-------------+--------------+--------------------+
1 row in set (0.00 sec)

mysql> select * FROM attachments WHERE attachments.file_name LIKE '%소유%';
+-----+--------------------------------------+---------------------+---------------------+-------------+--------------+--------------------------------------+
| id | image | created_at | updated_at | image_width | image_height | file_name |
+-----+--------------------------------------+---------------------+---------------------+-------------+--------------+--------------------------------------+
| 144 | 소유_어반자카파_녹음실.jpg | 2014-09-19 03:15:08 | 2014-10-13 07:02:21 | 5190 | 3438 | 소유_어반자카파_녹음실.jpg |
| 404 | 소유_어반자카파__틈.jpg | 2014-09-29 08:09:27 | 2014-10-13 07:02:23 | 1400 | 934 | 소유_어반자카파__틈.jpg |
+-----+--------------------------------------+---------------------+---------------------+-------------+--------------+--------------------------------------+
2 rows in set (0.00 sec)

最佳答案

您在 780, 소유 中的记录被编码为 ᄉ ᅩ ᄋ ᅲ(4 个字符)

但是您的搜索词是소유(2个字符)

http://farsightsoftware.com/utils/unicode-show-me.html?%EC%86%8C%EC%9C%A0http://farsightsoftware.com/utils/unicode-show-me.html?%E1%84%89%E1%85%A9%E1%84%8B%E1%85%B2

关于使用where子句时mysql不获取现有记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26480710/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com