前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SQLite 基础15

SQLite 基础15

作者头像
franket
发布2021-12-01 17:31:13
1960
发布2021-12-01 17:31:13
举报
文章被收录于专栏:技术杂记技术杂记

DELETE

代码语言:javascript
复制
sqlite> select * from company where id=7;
id          name        age         address     salary    
----------  ----------  ----------  ----------  ----------
7           James       24          test        10.0      
sqlite> delete from company where id=7;
sqlite> select * from company where id=7;
sqlite> select * from company;
id          name        age         address     salary    
----------  ----------  ----------  ----------  ----------
1           Paul        32          test        10.0      
2           Allen       25          test        10.0      
3           Teddy       23          test        10.0      
4           Mark        25          test        10.0      
5           David       27          test        10.0      
6           Kim         22          test        10.0      
sqlite> delete from company;
sqlite> select * from company;
sqlite>

LIKE

代码语言:javascript
复制
sqlite> select * from company where age like '%5';
id          name        age         address     salary    
----------  ----------  ----------  ----------  ----------
2           Allen       25          Texas       15000.0   
4           Mark        25          Rich-Mond   65000.0   
sqlite> 
sqlite> select * from company where address like '%-%';
id          name        age         address     salary    
----------  ----------  ----------  ----------  ----------
4           Mark        25          Rich-Mond   65000.0   
6           Kim         22          South-Hall  45000.0   
sqlite> 

GLOB

GLOB与LIKE类似,都是用来进行模糊匹配的,但是通配符使用的shell的规则 用* 替代 % 替代 _

代码语言:javascript
复制
sqlite> select * from company where age glob '*5';
id          name        age         address     salary    
----------  ----------  ----------  ----------  ----------
2           Allen       25          Texas       15000.0   
4           Mark        25          Rich-Mond   65000.0   
sqlite> select * from company where address glob '*-*';
id          name        age         address     salary    
----------  ----------  ----------  ----------  ----------
4           Mark        25          Rich-Mond   65000.0   
6           Kim         22          South-Hall  45000.0   
sqlite>
sqlite> select * from company where age glob '%5';
sqlite>

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • DELETE
  • LIKE
  • GLOB
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档