mysql 建表语句
修改id为自动增长: alter table book b_ISBN int(11) auto_increment;
自动增长要加的:auto_increment
基本的sql语句:
-
选择:select * from table where 范围
- 修改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