码迷,mamicode.com
首页 > 数据库 > 详细

Sqlte 知识点记录

时间:2015-06-03 22:55:48      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

1、表存在

select count(*) from sqlite_master where type=‘table‘ and name=‘MyTable‘;

sql="CREATE TABLE IF NOT EXISTS MusicList (id integer primary key AutoIncrement,name varchar(20),path varchar(20))";
desc <table> //查看表结构 
select * from <table> //查询所有更
select , from table ;//查看指定列
select distinct , from table ;//非重复查询
insert into users(_id,username,password) select * from users;//复制
select username from users where username like S% ;//非重名字首字母为大写S的用户
select username from users where username like __S% ;//非重名字第三个字母为大写S的用户
select * from users where _id in(001,220,230);
select * from user order by _id;//以id的顺序排列
select * from user order by _id desc;//以id反的顺序排
SELECT count(word) AS number FROM cet6_table;

SELECT [word],[explanation] FROM cet6_table ORDER BY word LIMIT 100 OFFSET 200"

 

Sqlte 知识点记录

标签:

原文地址:http://www.cnblogs.com/chenmfly/p/4550329.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!