简体   繁体   中英

How can I add a column with int datatype to a table in SQL using the ALTER command?

I tried the code given in a similar question but I'm getting the following error:

ALTER TABLE Employees ADD Salary, int;

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 ' int' at line 1

I'm new to MySQL and programming in general, please do tell me if the code is incorrect or if there are any rules to be followed when writing the code.

语法是 ALTER TABLE ADD COLUMN

ALTER TABLE Employees ADD COLUMN Salary int;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM