我的实例:
增加一个字段:
alter table book add name varchar(20);
觉得20太小,修改为50
alter table book change name name varchar(50);
增加几个字段:
alter table book add authors varchar(100),add category varchar(20),add
price double(10,2);
删除一列:
alter table book drop cover;
在某个位置加上1列:
alter table book add cover varchar(100) after(first) publishdate;
修改某条记录某个字段或多个字段的值:
update book set column_name1="" where column_name2="";
删除一条记录:
delete from table_name where where_contion;
修改某个表中的记录的顺序:
alter table book order by bookid(默认为升序降序为desc);
增加一个字段:
alter table book add name varchar(20);
觉得20太小,修改为50
alter table book change name name varchar(50);
增加几个字段:
alter table book add authors varchar(100),add category varchar(20),add
price double(10,2);
删除一列:
alter table book drop cover;
在某个位置加上1列:
alter table book add cover varchar(100) after(first) publishdate;
修改某条记录某个字段或多个字段的值:
update book set column_name1="" where column_name2="";
删除一条记录:
delete from table_name where where_contion;
修改某个表中的记录的顺序:
alter table book order by bookid(默认为升序降序为desc);