- 查找语句
select id,strCN,strEN from String2 where strCN == ''
从表String2中查找三列数据:id、strCN、strEN其中条件是strCN这一列为空。
查找语句还可以嵌套使用例如:
select id,strCN,strEN from String2 where strCN != '' and id not in (select id from String2 where strEN != '')
从表String2中查找三列数据:id、strCN、strEN。其中,条件是strCN不为空,并且id不在strEN为空的范围内。概括起来就讲,这个条件就是strCN不为空,strEN为空。
模糊查找语句
select id,strCN,strEN from String2 where strCN like ‘%\n%’
从表String2中查找三列数据:id、strCN、strEN。其中,条件是词条中包含有’\n’。
- 删除语句
delete from String2 where id == 100
从表String2中删除id为100的项。
- 增加一个项语句
insert into String2 (id,strEN) values ('1044055','camshaft position actuator circuit')
向String2中添加一条,该条数据是:id是1044055,strEN为camshaft position actuator circuit。
- 更新一条数据
update String set strFR = '' where id = 1080692
更新表String中的strFR列。其中,条件是id等于1080692。
- 列出一个表的信息
pragma table_info([StringAttrib_Brand])
列出表StringAttrib_Brand的信息
- 给某张表增加一列
alter table StringAttrib_Brand add column strD
在表StringAttrib_Brand中新增一列名字为strD
- 获得某张表中主键的最大值
Select max(id) from String
说明:从表String中获得主键id的最大值
备注:屏蔽一个语句用“–”
- 将某一列的数据复制到一个新的列中去
update String set strDU=strNE where id = 100
说明:将String表中id=100的strEN列数据复制到strDU列中去