You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to    use near ') NULL after `time`,
  add column `total` int(20) NULL after `price`,

解决方案 »

  1.   


    -- 你的语句是怎么写的 ?mysql> create table test(id int, price int) ;
    Query OK, 0 rows affected (0.00 sec)mysql> insert into test values(100,200) ;
    Query OK, 1 row affected (0.00 sec)mysql>
    mysql> alter table test add column xxx int(20) NULL after `price`;
    Query OK, 1 row affected (0.00 sec)
    Records: 1  Duplicates: 0  Warnings: 0mysql>
    mysql> select * from test;
    +------+-------+------+
    | id   | price | xxx  |
    +------+-------+------+
    |  100 |   200 | NULL |
    +------+-------+------+
    1 row in set (0.00 sec)mysql>
    mysql> drop table test ;
    Query OK, 0 rows affected (0.00 sec)mysql>
      

  2.   

    add column前面的alter table要加上。例似
     alter table test add column xxx int(20) NULL after `price`;