SQLite喜欢%和_

我不知道下划线字符在sqlite like语句中做什么。
通配符%,可能与大多数其他sql数据库中相同。

那么,该死的角色做什么?

下划线也与大多数其他sql数据库中的相同,并匹配任何单个字符(即,它与正则表达式中的相同)。从 fine manual

An underscore (“_”) in the LIKE pattern matches any single character in the string.

例如:

-- The '_' matches the single 'c'
sqlite> select 'pancakes' like 'pan_akes';
1
-- This would need '__' to match the 'ca',only one '_' fails.
sqlite> select 'pancakes' like 'pan_kes';
0
-- '___' also fails,one too many '_'.
sqlite> select 'pancakes' like 'pan___kes';
0

只是为了确保结果有意义:sqlite使用zero and one for booleans

相关文章

SQLite架构简单,又有Json计算能力,有时会承担Json文件/RES...
使用Python操作内置数据库SQLite以及MySQL数据库。
破解微信数据库密码,用python导出微信聊天记录
(Unity)SQLite 是一个软件库,实现了自给自足的、无服务器...
安卓开发,利用SQLite实现登陆注册功能