I'm trying to use a very basic alter table command to position a column after another column.
This is the table as it exists now:
mysql> describe car_table; +---------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+--------------+------+-----+---------+----------------+ | car_id | int(11) | NO | PRI | NULL | auto_increment | | vin | varchar(17) | YES | | NULL | | | color | varchar(10) | YES | | NULL | | | year | decimal(4,0) | YES | | NULL | | | make | varchar(10) | YES | | NULL | | | model | varchar(20) | YES | | NULL | | | howmuch | decimal(5,2) | YES | | NULL | | +---------+--------------+------+-----+---------+----------------+ 7 rows in set (0.03 sec)
I am trying to position the 'color' column after the 'model' column with the following command:
mysql> alter table car_table modify column color after model;
And I'm getting the following error:
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 'after model' at line 1
I'm just wondering what I'm doing wrong here, because the syntax looks correct to me!
Carsten Pedersen Re: alter table modify syntax error
Jun 28, 2014; 19:24
Carsten Pedersen
Re: alter table modify syntax error
Jun 28
Tim Dunphy Re: alter table modify syntax error
Jun 28, 2014; 13:34
Tim Dunphy
Re: alter table modify syntax error
Jun 28
Tim Dunphy Re: alter table modify syntax error
Jun 28, 2014; 13:44
Tim Dunphy
Re: alter table modify syntax error
Jun 29
Jesper Wisborg Krogh RE: alter table modify syntax error
Jun 29, 2014; 09:46
Jesper Wisborg Krogh
RE: alter table modify syntax error
Jun 28
Tim Dunphy Re: alter table modify syntax error
Jun 28, 2014; 20:09
Tim Dunphy
Re: alter table modify syntax error
Jun 29
Jesper Wisborg Krogh RE: alter table modify syntax error
Jun 29, 2014; 11:14
Jesper Wisborg Krogh
RE: alter table modify syntax error
Jun 28
Tim Dunphy Re: alter table modify syntax error
Jun 28, 2014; 21:40
Tim Dunphy
Re: alter table modify syntax error
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!