Home > Enterprise >  What is the wrong with the syntax in this line?
What is the wrong with the syntax in this line?

Time:11-27

ALTER TABLE Student MODIFY(city varchar(20));

I don't understand what is wrong, it says the message ERROR: 1064: 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 '(city varchar(20))' at line 1.

CodePudding user response:

When reading the documentation you do not need the ( and the ) around the column_definition

You should use:

ALTER TABLE Student MODIFY city varchar(20) ;

see: DBFIDDLE

  • Related