谢谢,正是我需要的
原文地址:SQLite语法和操作演示
作者:yanhong
sqlite语法和操作演示
@H_301_13@
@H_301_13@ 以下命令在sqlite3.6.13 中测试通过!
@H_301_13@
@H_301_13@
@H_301_13@ [所有表名]
Select name FROM sqlite_master Where type="table";
@H_301_13@
Select name FROM sqlite_master Where type="table" UNION Select
@H_301_13@ name FROM sqlite_temp_master Where type="table" orDER BY name;//包括临时表
@H_301_13@
@H_301_13@ [所有索引名]
Select name FROM sqlite_master Where type="index" orDER BY name;
@H_301_13@
@H_301_13@ [创建表]
Create TABLE test(id PARPRENT KEY,name);
@H_301_13@
@H_301_13@ [插入新内容]
Insert INTO test(name) VALUES('
HouSoft'); [查询数据] Select * FROM test; //查询表中所有数据 Select * FROM test Where id=1; //查询表中符合条件的数据 [删除数据] Delete FROM test; //删除表中所有数据 Delete FROM test Where id=1; //删除表中符合条件的数据 [重命名表名] Alter TABLE test RENAME TO test2; [添加新字段] Alter TABLE test ADD comment; [更新字段值] Update test SET comment='主页:Www.YrYz.Net' Where id=1; [查询本地时间] Select DATETIME(CURRENT_TIMESTAMP,'localtime');