我需要向表中添加多列,但將列放置在名爲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) –