ALTER TABLE tada_prod
.action_6_weekly
ADD COLUMN id
INT NULL AUTO_INCREMENT UNIQUE AFTER member_id
;
works,
so i thought, to add the column as the first column i could do
ALTER TABLE `tada_prod`.`action_6_weekly` ADD COLUMN `id` INT NULL AUTO_INCREMENT UNIQUE BEFORE `code`;
but i get a syntax error, what is the correct syntax?
ALTER TABLE `tada_prod`.`action_6_weekly`
ADD COLUMN `id` INT NULL AUTO_INCREMENT UNIQUE FIRST;
You can add column only after particular field or at first not before.
The mysql query for add column after particular filed is:ALTER TABLE table_name ADD COLUMN column_name VARCHAR(30) AFTER column_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With