mysql不支持嵌套列更改

时间:2016-07-06 08:40:53

标签: mysql

    ALTER TABLE `paylist` 
  DROP PRIMARY KEY, 
  ADD PRIMARY KEY(`id`), 
  CHANGE COLUMN payment_method payment_method varchar(20) NULL AFTER supplier_id, 
  CHANGE COLUMN supplier_id supplier_id varchar(32) NULL AFTER property_number;

上述规则给出了错误:错误:'paylist'中的未知列'supplier_id'。但它们可以在separte statment中运行。例如。

 ALTER TABLE `paylist`  CHANGE COLUMN payment_method payment_method varchar(20) NULL AFTER supplier_id;

ALTER TABLE `paylist`  CHANGE COLUMN  supplier_id supplier_id varchar(32) NULL AFTER property_number;

0 个答案:

没有答案