Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试使用 LIKE 运算符进行搜索:
SELECT author_id, header, text FROM blog_u.posts WHERE text LIKE '%Samsung%';
它适用于拉丁符号,但不适用于俄语
SELECT author_id, header, text FROM blog_u.posts WHERE text LIKE '%Проверка%';
我的 utf-8 数据库。请帮帮我
作为我评论的后续行动,我认为您对LIKE. 但是,您必须确保要搜索的内容具有等效的 ascii 值。
LIKE
例如,考虑一下:
select * from posts where Text Like '%Проверка%'; select ascii('p'); select ascii('р');
'p' 在两者中看起来相同,但 ascii 版本确实不同——一个有效,另一个无效。我在您的上述声明中复制了 p 而不是在我的键盘上键入 ap 。
这是一个 Fiddle 来演示。