MySQL指定列後插入新列,mysql指定列插入

來源:互聯網
上載者:User

MySQL指定列後插入新列,mysql指定列插入
ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name
    alter_specification [, alter_specification] ...

alter_specification:
    table_options
  | ADD [COLUMN] col_name column_definition
        [FIRST | AFTER col_name ]
  | ADD [COLUMN] (col_name column_definition,...)
  | ADD {INDEX|KEY} [index_name]
        [index_type] (index_col_name,...) [index_option] ...

....

以上命令可以在MySQL命令列中鍵入help alter或help alter table獲得

很顯然從文法上看,要麼 ADD [COLUMN] col_name column_definition  [FIRST | AFTER col_name ]
要麼,ADD [COLUMN] (col_name column_definition,...)

加多個列的時候,無法  [FIRST | AFTER col_name ]

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.