-2

I am tasked to create a column with a null value but I got an error.

SELECT * FROM test.Persons
ALTER TABLE Persons
ADD mark_percentage FLOAT

This is my error.

12:32:47 use database test ALTER TABLE PERSONS ADD MARKS float SELECT * FROM test.Persons Error Code: 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 'database test ALTER TABLE PERSONS ADD MARKS float SELECT * FROM test.Persons' at line 1 0.063 sec

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
kdb014
  • 25
  • 1
  • Does this answer your question? [How can I fix MySQL error #1064?](https://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064) – Obsidian Age Aug 03 '22 at 04:43
  • those are two different commands. ALTER table doesn't return anything to select from, it just alters a table – nvuono Aug 03 '22 at 04:43

1 Answers1

0

Try this :

ALTER TABLE Persons
ADD mark_percentage FLOAT
Md. Suman Kabir
  • 5,243
  • 5
  • 25
  • 43