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

(编辑:jimmy 日期: 2024/9/22 浏览:2)

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 ;

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

一句话新闻
Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。