Adding a column after another within SQL (MySQL)

MySQL

 

The world's second most used open-source database. Skyvia requires the server to be available from Internet. Skyvia supports MySQL, Percona, and MariaDB servers.

Add multiple columns after a specific column to an existing MySQL table

Query Text

CREATE TABLE _test (
  Id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  value varchar(255) DEFAULT NULL,
  PRIMARY KEY (Id)
);

ALTER TABLE _test
ADD COLUMN `count` SMALLINT(6) NOT NULL AFTER `value`,
ADD COLUMN `log` VARCHAR(12) NOT NULL AFTER `count`,
ADD COLUMN `status` INT(10) UNSIGNED NOT NULL AFTER `log`;
  

Open Query