sqlite 增删改查语法使用

来源:互联网 发布:手机淘宝店小二在哪 编辑:程序博客网 时间:2024/06/11 13:48

DBFriendBean表

1.插入语句

insertinto 表明(表中存在字段,表中存在字段)values(表中存在字段对应的value,表中存在字段对应的value)

使用:   insert into DBFriendBean(insertUserId,userName) values(7,'葫芦娃')

插入结果:



2.  删除语句

deletefrom 表名where 条件子句

delete from DBFriendBean  where userId = 'PL961171'

删除前:

删除后:



3.更新语句:

update 表名set 字段名=where 条件子句。如:update person set name=‘智深‘where id=10

update DBFriendBean set userName = '小沈陽' where userId = 'PL982122'

更新前:


更新后:



4.查询语句:

select*(*代表全部字段都查询可以把*换成其他对应字段)from 表名where 条件子句groupby 分组字句(或 order by 或其他语句)

表中存在数据:


查询语句使用:

select * from DBFriendBean where insertUserId = '3'



select headImg from DBFriendBean 



0 0
原创粉丝点击