Not sure why these two lines aren't letting me add a column.
ALTER TABLE people
ADD COLUMN job_desc VARCHAR(15) BEFORE salary;
Not sure why these two lines aren't letting me add a column.
ALTER TABLE people
ADD COLUMN job_desc VARCHAR(15) BEFORE salary;
From the documentation, the syntax is:
ADD [COLUMN] col_name column_definition [FIRST | AFTER col_name]
You can use FIRST
or AFTER
, but not BEFORE
. If you want to put it before a particular column, find the preceding column and put it AFTER
that one. If you want to put it before the first column, use FIRST
.