zoukankan      html  css  js  c++  java
  • Mysql 增加删除字段

    MySQL添加字段和修改字段

     

    MySQL添加字段的方法并不复杂,下面将为您详细介绍MYSQL添加字段和修改字段等操作的实现方法,希望对您学习MySQL添加字段方面会有所帮助。

    1添加表字段

    alter table table1 add transactor varchar(10) not Null;

    alter table   table1 add id int unsigned not Null auto_increment primary key

    2.修改某个表的字段类型及指定为空或非空
    alter table 表名称 change 字段名称 字段名称 字段类型 [是否允许非空];
    alter table 表名称 modify 字段名称 字段类型 [是否允许非空];

    alter table 表名称 modify 字段名称 字段类型 [是否允许非空];

    3.修改某个表的字段名称及指定为空或非空
    alter table 表名称 change 字段原名称 字段新名称 字段类型 [是否允许非空

    4如果要删除某一字段,可用命令:ALTER TABLE mytable DROP 字段名;

  • 相关阅读:
    position中的四种属性
    CSS中link和@import的区别
    隐藏对应元素的办法
    word20161217
    word20161216
    word20161215
    word20161214
    word20161213
    word201612012
    word20161211
  • 原文地址:https://www.cnblogs.com/wangxiaowang/p/9229390.html
Copyright © 2011-2022 走看看