我需要向表中添加多列,但将列放置在名为lastname
的列之后。alter table在列1后面添加多列1
我已经试过这样:
ALTER TABLE `users` ADD COLUMN
(
`count` smallint(6) NOT NULL,
`log` varchar(12) NOT NULL,
`status` int(10) unsigned NOT NULL
)
AFTER `lastname`;
我得到这个错误:
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 ') AFTER
lastname
' at line 7
我怎么能在这样的查询使用后?
你说的是什么话?看起来像MySQL给我。但是'ALTER TABLE'语法在方言之间稍有不同。 –
对不起,是的mysql。 – Koala
[MySQL Alter Table添加字段之前或之后字段已存在]的可能重复(http://stackoverflow.com/questions/3379454/mysql-alter-table-add-field-before-or-after-a-field -already-present) –