H:/Ruby192/bin>sqlite3 a.db
SQLite version 3.7.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .database;
Error: unknown command or invalid arguments: "database;". Enter ".help" for he
p
sqlite> .database
seq name file
--- --------------- ---------------------------------------------------------
0 main H:/Ruby192/bin/a.db
sqlite> .table
a
sqlite> insert into a(1)
...> ;
Error: near "1": syntax error
sqlite> select * from a;
sqlite> selet * from a
...> ;
Error: near "selet": syntax error
sqlite> select * from a;
sqlite> insert a (id) values(1);
Error: near "a": syntax error
sqlite> insert a (id) values(1);
Error: near "a": syntax error
sqlite> insert into a (id) values(1);
sqlite> select * from a;
1
sqlite> insert into a (id) values(12);
sqlite> insert into a (id) values(13);
sqlite> insert into a (id) values(15);
sqlite> select * from a;
1
12
13
15
sqlite> alter table a (add column b varchar(10));
Error: near "(": syntax error
sqlite> alter table a add column b varchar(10);
sqlite> insert into a (id) values(16,'a');
Error: 2 values for 1 columns
sqlite> insert into a (id,b) values(16,'a');
sqlite> select * from a;
1|
12|
13|
15|
16|a
sqlite> select top 1 * from a ;
Error: near "1": syntax error
sqlite> select * from a limit 1;
1|
sqlite> select * from a order by id desc limit 1;
16|a
sqlite> select * from a order by id desc limit 1 to 2;
Error: near "to": syntax error
sqlite> select * from a order by id desc limit 10;
16|a
15|
13|
12|
1|
sqlite>
OS X自从10.4后把SQLite这套相当出名的数据库软件,放进了作业系统工具集里。OS X包装的是第三版的SQLite,又称SQLite3。这套软件有几个特色:
- 软件属于公共财(public domain),SQLite可说是某种「美德软件」(virtueware),作者本人放弃着作权,而给使用SQLite的人以下的「祝福」(blessing):
- May you do good and not evil. 愿你行善莫行恶