首页  >  文章  >  数据库  >  Mysql基本语句——增删改查

Mysql基本语句——增删改查

零下一度
零下一度原创
2017-05-02 09:42:311575浏览

这篇文章主要介绍了Mysql的增删改查语句简单实现的相关资料,需要的朋友可以参考下

Mysql的增删改查语句简单实现

增加记录:


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 ;

以上是Mysql基本语句——增删改查的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn