码迷,mamicode.com
首页 > 移动开发 > 详细

ios sqlite

时间:2015-06-02 11:16:56      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

Last login: Tue Jun  2 08:39:17 on console
sunlihuodeMacBook-Air:~ sunlihuo$ pwd
/Users/sunlihuo
sunlihuodeMacBook-Air:~ sunlihuo$ sqlite3 test.sqlite
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> create table if not exists test(id integer primary key, name varchar2, age int);
sqlite> .tables
test
sqlite> .tables
test
sqlite> .schema test
CREATE TABLE test(id integer primary key, name varchar2, age int);
sqlite> alter table test add column test int;
sqlite> .schema test
CREATE TABLE test(id integer primary key, name varchar2, age int, test int);
sqlite> insert into test (name, age) values (‘sunlihuo‘,18);
sqlite> select * from test;
1|sunlihuo|18|
sqlite> .mode column
sqlite> .headeron
Error: unknown command or invalid arguments:  "headeron". Enter ".help" for help
sqlite> select * from test;
1           sunlihuo    18                    
sqlite> .header on
sqlite> select * from test;
id          name        age         test      
----------  ----------  ----------  ----------
1           sunlihuo    18                    
sqlite> update table set name = ‘sunlili‘ where id = 1;
Error: near "table": syntax error
sqlite> update test set name = ‘sunlili‘ where id = 1;
sqlite> select * from test;
id          name        age         test      
----------  ----------  ----------  ----------
1           sunlili     18                    
sqlite> drop table if exists test;
sqlite> select * from test;
Error: no such table: test
sqlite>

ios sqlite

标签:

原文地址:http://blog.csdn.net/sunlihuo/article/details/46324701

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