pc@pc-host:~/MyScripts/sqltest$ sqlite3 --version
3.23.1 2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b
pc@pc-host:~/MyScripts/sqltest$ sqlite3 sampledb.db
sqlite> .schema students
CREATE TABLE students(id integer primary key,name text,country text, thereal real, theint integer);
sqlite> select * from students;
id name country thereal theint
---------- ---------- ---------- ---------- ----------
1 Michael usa 12.6 12
2 John usa 5.78 5
3 Jack usa 12.6 12
4 Sara usa 5.78 5
5 Sally usa 12.6 12
6 Jena usa 5.78 5
7 Nancy usa 12.6 12
8 Adam usa 5.78 5
9 Stevens usa 12.6 12
这不起作用:
sqlite> select name,country from students where name GLOB '^[A-za-z]*a$';
无输出...
但是这样做:
sqlite> select name,country from students where name GLOB '[A-za-z]*a';
name country
---------- ----------
Sara usa
Jena usa
为什么?我知道在这种情况下,使用“ ^ $”作为名称是多余的,但出于好奇。
答案 0 :(得分:1)