SQLite不区分重音的搜索 [英] SQLite accent-insensitive search
本文介绍了SQLite不区分重音的搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以在SQLite中执行不区分重音的LIKE查询吗?例如,以下查询:
Is there any way to do an accent-insensitive LIKE query in SQLite? For example, this query:
SELECT * FROM users WHERE name LIKE "Andre%"
将得到回报:
André the Giant
Andre Agassi
etc.
我正在将Qt与QSqlDatabase一起使用,如果有区别的话。
I'm using Qt with QSqlDatabase if it makes any difference.
推荐答案
设置使用 sqlite3_create_collation
进行排序规则 >,然后像这样使用它:
Set up a collation using sqlite3_create_collation
and then use it like this:
SELECT * FROM users WHERE name LIKE "Andre%" COLLATE NOACCENTS
这篇关于SQLite不区分重音的搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文