下划线也与大多数其他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。