修改id为自动增长: alter table book b_ISBN int(11) auto_increment;
自动增长要加的:auto_increment
基本的sql语句:
选择:select * from table where 范围
- 插入:insert into table(field1,field2) values(value1,value2)
- 删除:delete from table where 范围
- 更新:update table set field1=value1 where 范围
- 查找:select * from table where field1 like ’%value1%’
- 排序:select * from table order by field1,field2 [desc]
- 修改id为自动增长 alter table book b_ISBN int(11) auto_increment
- 总数:select count as totalcount from table
- 求和:select sum(field1) as sumvalue from table
- 平均:select avg(field1) as avgvalue from table
- 最大:select max(field1) as maxvalue from table
- 最小:select min(field1) as minvalue from table