常用的语句:
查询select:
查询所有:
select * from tableName;
查询id=?:
select * from tableName where id=?;
分页查询:
//其中m=(pageNum-1)*pageSize
//n=pageSize
select * from tableName limit m,n;
//从第1个开始,找3条数据
select * from tableName limit (1-1),3;
//从第2个开始,找3条数据
select * from tableName limit (2-1),3;
返回表中有多少行:
select count(*) from tableName;
插入insert:
insert into tableName (column1, column2,...) values ('value1', 'value2',...);
更改update:
update tableName set column1 = 'value1', column2 = 'value2' WHERE id = ?;
删除delete:
delete from tableName WHERE id = ?;