mysql> ALTER TABLE zMem ADD fName VARCHAR(14) FIRST Address;
ERROR 1064 (42000): 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 'Address' at line 1
如上,想在 zMem 表的 Address 列前加上一个 fName 列,却出现错误,我是新手,的确也不确定语法是否正确。
但用 AFTER 却能行:
mysql> ALTER TABLE zMem ADD fName VARCHAR(14) AFTER Address;
Query OK, 0 rows affected (0.22 sec)
Records: 0 Duplicates: 0 Warnings: 0请问关于 FIRST 的正确的语句是什么?
ERROR 1064 (42000): 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 'Address' at line 1
如上,想在 zMem 表的 Address 列前加上一个 fName 列,却出现错误,我是新手,的确也不确定语法是否正确。
但用 AFTER 却能行:
mysql> ALTER TABLE zMem ADD fName VARCHAR(14) AFTER Address;
Query OK, 0 rows affected (0.22 sec)
Records: 0 Duplicates: 0 Warnings: 0请问关于 FIRST 的正确的语句是什么?
FIRST后面不能加列名只有after 后面能加列名
AFTER是在某个列后面插入一个,你可以在你像插入的列的前面的那个列的后面插入;
要不,你试试用BEFORE ,与AFTER 对应,
不过,我从来每用过,我都是用AFTER。呵呵
谢谢