Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql add column after another

-- ALTER TABLE tbl_name ADD COLUMN column_name column_definition 
--		[FIRST|AFTER existing_column];
ALTER TABLE office ADD COLUMN phone VARCHAR(200) DEFAULT '000' AFTER name;
ALTER TABLE office ADD COLUMN flag INT(1) FIRST;
ALTER TABLE office ADD COLUMN last_col INT(2);	-- Last column is default position
-- ↓ Test it (Fiddle)
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle convert int to date 
Sql :: identify number of rows in sql 
Sql :: replace string value in sql 
Sql :: mysql subdate 
Sql :: set id count mysql 
Sql :: find lowest number in sql 
Sql :: how to find database collation in postgres 
Sql :: concat column data in sql laravel 
Sql :: DROP TABLes regardless of constraints 
Sql :: apex set debug level 
Sql :: drop table if exists test 
Sql :: insert current date sql 
Sql :: how to change a collumn name in sql 
Sql :: restart sql server command line linux 
Sql :: avg mysql 
Sql :: oracle first row 
Sql :: mysql show views 
Sql :: mysql email validation 
Sql :: import mysql dump command line 
Sql :: how to create a sql database 
Sql :: postgresql connection string c# 
Sql :: sql all columns 
Sql :: delete ids between sql 
Sql :: get column types SQL SERVER 
Sql :: sql count null as 0 
Sql :: update join sql 
Sql :: Parsing XML IN SQL Server 
Sql :: import sql dump into postgresql database 
Sql :: c# sqldatareader to list 
Sql :: sql select where in 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =