MySQL 5 does not recognize BEFORE?

In MySQL 5.0.51b on my Mac, ordinals outside of FIRST don't work as before.

So,

ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) FOURTH;

      

does not work completely like

ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) BEFORE email;

      

Do they work with any other flavors or versions of MySQL?

+1


a source to share


1 answer


I doubt they work differently on other OS installations, since the mysql docs for alter table in 5.0 don't offer the BEFORE modifier. I recommend using AFTER (or FIRST if you are inserting this as the first column into the table) instead.



ALTER TABLE my_contacts
ADD COLUMN phone VARCHAR(10) AFTER some_column_name;

      

+3


a source







All Articles