如果你还没有安装或者使用过 sqlite,可以借助 SQLite3 安装、基本操作 入门。1. 创建数据库 test.dbcd ~/sqlite3 test.db这样在 ~/ 目录下面就生成一个数据库文件 test.db.2. 创建表 songcreate table if not exists song (path TEXT, title varchar(20));创建一个名称为 song 的数据库表,包含 path、title 两个字段,类型分别是 Text、varchar.3. 插入数据insert into song values("/mnt/sdcard/music","only you");insert into song values("/mnt/sdcard/music","love"); insert into song values("/exte/music","thinking");共插入 3 条数据。这个时候,验证一下,数据库表中的数据。查询:select * from song;4. 查询指定条件的数据select * from song where path="/mnt/sdcard/music"或者select * from song where path="/mnt/sdcard/music"现在有个需求,查出所有 / 目录下面的歌曲信息?当然是模糊查询!select * from song where path LIKE "/%"; 或者select * from song where path LIKE "/%";轻松搞定!SQL 内置函数(pivot) 纵转横SQLite3 安装、基本操作相关资讯 SQLite3 SQLite教程
- SQLite3简单操作 (01月29日)
- SQLite3中存储类型和数据类型结合 (08/20/2015 12:37:06)
- SQLite在micro上的移植 (12/12/2012 09:49:11)
| - SQLite3 设置插入触发器 (08/23/2015 10:30:07)
- Python 之SQLite3 (01/04/2013 18:10:02)
- Python 在Linux中使用SQLite3 (09/15/2012 09:46:41)
|
本文评论 查看全部评论 (0)