您的位置:首页 > 数据库 > MySQL

Mysql的增删改查语句

2016-10-27 23:08 330 查看
增加记录:

insert into tablename(...) values(...)
//如果增加的记录包括所有的列,则不需要写数据列表
insert into tablename values(...)


删除记录:

delete from tablename where condition ;


修改记录:

update tablename set xx=xx , xx=xx... where condition ;

alter table tablename set xx=xx , xx=xx... where condition ;


查询记录:

select (...) from tablename where condition ;

select * from tablename where condition ;


删除整个表:

drop table tablename ;


添加列:

alter table tablename add column columnname columntype ... ;


删除列:

alter table tablename drop column columnname ;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: