最近重新拾起FMDB ,对数据库 SQL查询简单记录下。
(ps: y-字段,x-值,table- 表)
1. select y from table_name (select * from table_name)-- 查询字段
2. select didtinct y from table_name -- 去掉重复内容 (结果中元素有且只有一个)
3.WHERE(where) select y from table_name where y 运算符 值 -- 选出 表名 字段 符合取值条件 内容
4.
5.
6. insert into table_name values (x1,x2,...)
insert into table_name (y1,y2,...) values (x1,x2,...)
7. update table_name set y1 = new_value where y1 = x1
8. delete from table_name where y = x
FMDB
1.FMDatabase -- 表示一个SQLite数据库,执行SQLite的命令2.FMResultSet - 表示FMDatabase执行查询后结果集。
3.FMDatabaseQueue - 如果你想在多线程中执行多个查询或更新,你应该使用该类。线程安全的