首页 > 移动平台 > 详细

Android-sqlite-SQL语句大全

时间:2018-12-07 17:35:34      阅读:191      评论:0      收藏:0      [点我收藏+]

创表语句:

create table student_table(_id integer primary key autoincrement, name text, age integer);

 

在升级过程中,添加表字段:注意升级过程中新增到表子段要允许为null

alter table student_table add age integer null

 

增删改查系列之查询:

select _id,name,age from student_table;
select * from student_table;
select * from student_table where _id = 1;

 

增删改查系列之新增:

insert into student_table(name,age) values(刘德利,19);

 

增删改查系列之更新:

update student_table set name=德利 where _id = 1;

 

增删改查系列之删除:

delete from student_table where _id = 1;

 

其他语句:

// 判断不存在才执行
IF
NOT EXISTS if not exists

 

Android-sqlite-SQL语句大全

原文:https://www.cnblogs.com/android-deli/p/10084012.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!