In MySQL 5.0.51b on my Mac, ordinals beyond FIRST fail, as does BEFORE.
在Mac上的MySQL 5.0.51b中,除了FIRST之外的序数都失败了,BEFORE也是如此。
So,
ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) FOURTH;
fails altogether, as would
完全失败,就像那样
ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) BEFORE email;
Do these work with any other flavors or versions of MySQL?
这些可以与任何其他风格或MySQL版本一起使用吗?
1 个解决方案
#1
I doubt they work any differently on other OS installations as the mysql docs for alter table in 5.0 don't offer a BEFORE modifier. I recommend using AFTER instead (or FIRST if you're inserting this as the first column in the table).
我怀疑它们在其他操作系统安装上的工作方式有所不同,因为5.0中的alter table的mysql文档不提供BEFORE修饰符。我推荐使用AFTER(或者如果您将其作为表格中的第一列插入,则为FIRST)。
ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) AFTER some_column_name;
#1
I doubt they work any differently on other OS installations as the mysql docs for alter table in 5.0 don't offer a BEFORE modifier. I recommend using AFTER instead (or FIRST if you're inserting this as the first column in the table).
我怀疑它们在其他操作系统安装上的工作方式有所不同,因为5.0中的alter table的mysql文档不提供BEFORE修饰符。我推荐使用AFTER(或者如果您将其作为表格中的第一列插入,则为FIRST)。
ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) AFTER some_column_name;