Mysql的增删改查语句简单实现
增加记录:
复制代码
1
2
3insert into tablename(...) values(...) //如果增加的记录包括所有的列,则不需要写数据列表 insert into tablename values(...)
删除记录:
复制代码
1delete from tablename where condition ;
修改记录:
复制代码
1
2
3update tablename set xx=xx , xx=xx... where condition ; alter table tablename set xx=xx , xx=xx... where condition ;
查询记录:
复制代码
1
2
3select (...) from tablename where condition ; select * from tablename where condition ;
删除整个表:
复制代码
1drop table tablename ;
添加列:
复制代码
1alter table tablename add column columnname columntype ... ;
删除列:
复制代码
1alter table tablename drop column columnname ;
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
最后
以上就是忧郁鼠标最近收集整理的关于Mysql的增删改查语句简单实现的全部内容,更多相关Mysql内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复