首页 > 数据库技术 > 详细

sql对于表格中列的删改

时间:2019-12-28 09:30:20      阅读:74      评论:0      收藏:0      [点我收藏+]

mysql与oracle

char为定长字符串

var为可变字符串

修改表名:rename table1 to table2;(mysql)

                 alter table1 rename to table2(oracle)

 

新增列名:alter table product(表名)add column product_1 varchar(40) not null,add column product_2;(mysql)

                  alter table product  (表名)   add  (product_1 varchar(40) not null,product_2);(oracle)

 

                  alter table product  (表名)   drop  column product_1,drop column product_2;

                  alter table product  (表名) drop (prodict_1,product_2);

mysql修改列名要重复的加add column,drop column,oracle只需要加()

sql对于表格中列的删改

原文:https://www.cnblogs.com/Thelightone/p/12110734.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!