sqlite3->select id,name from new_contacts where id <4AND id >=2;
id name
---------- ----------2 ddd
3 eee
sqlite3->select id,name from new_contacts where id =5OR id =3;
id name
---------- ----------3 eee
5 ddd
sqlite3->select id,name from new_contacts where id <5AND id >1ANDNOT (id =4);
id name
---------- ----------2 ddd
3 eee
sqlite3->select id,name from new_contacts where id in (0,5,3);
id name
---------- ----------3 eee
5 ddd
sqlite>SELECT*FROM new_contacts WHERE name LIKE'Z%';
id name phone email address
---------- ---------- ----------- ---------- ----------1 zyf 13567890987no address
4 zyf UNKNOW no address
sqlite>select*from new_contacts where name like'%ac%P%';
id name phone email address
----- -------------------- ---------- ---------- ----------7 Guacamole Dip UNKNOW no address
8 Peach Schnapps UNKNOW no address
9 Mackinaw Peaches UNKNOW no address
10 Pie (Blackberry) Pie UNKNOW no address
sq->select*from new_contacts where name like'%ac%'and name notlike'p%';
id name phone email address
---------- -------------------------------------------------- ---------- ---------- ----------7 Guacamole Dip UNKNOW no address
9 Mackinaw Peaches UNKNOW no address
12 ac Pie Pie UNKNOW no address
sq->select*from new_contacts where name glob 'Pie*';
id name phone email address
---------- -------------------------------------------------- ---------- ---------- ----------10 Pie (Blackberry) Pie UNKNOW no address
13 Pie accc UNKNOW no address
?的匹配:
sq->select*from new_contacts where name glob 'P?ie';
id name phone email address
---------- -------------------------------------------------- ---------- ---------- ----------23 Pcie UNKNOW no address