MySQL Forums
Forum List  »  Newbie

what is wrong with my syntax?
Posted by: R J
Date: October 24, 2010 12:05AM

Hi,

I am trying this ALTER statement below and getting a syntax error. I can't figure out where the error is coming from. Please take a look.

Thanks!

TABLE info below. ALTER statement and error after at the end.


CREATE TABLE `car_table2` (
`car_id` int(11) NOT NULL AUTO_INCREMENT,
`VIN` varchar(17) DEFAULT NULL,
`color` varchar(20) DEFAULT NULL,
`year` varchar(4) DEFAULT NULL,
`make` varchar(20) DEFAULT NULL,
`model` varchar(20) DEFAULT NULL,
`price` decimal(7,2) DEFAULT NULL,
PRIMARY KEY (`car_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;


insert into `car_table2`(`car_id`,`VIN`,`color`,`year`,`make`,`model`,`price`) values (1,null,'silver','1998','Porsche','Boxter',17992.54);
insert into `car_table2`(`car_id`,`VIN`,`color`,`year`,`make`,`model`,`price`) values (2,null,null,'2000','Jaguar','XJ',15995);
insert into `car_table2`(`car_id`,`VIN`,`color`,`year`,`make`,`model`,`price`) values (3,null,'red','2002','Cadillac','Escalade',40215.9);


ALTER TABLE car_table2
MODIFY COLUMN color AFTER model,
MODIFY COLUMN year AFTER color;

Category Timestamp Duration Message Line Position
Error 10/24/2010 11:33:15 AM 0:00:00.031 MySQL Database Error: 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,
MODIFY COLUMN year AFTER color' at line 2 1 0

Options: ReplyQuote


Subject
Written By
Posted
what is wrong with my syntax?
R J
October 24, 2010 12:05AM
R J
October 24, 2010 12:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.