📜  Mysql 查询添加具有默认字符串值的列 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:57.234000             🧑  作者: Mango

代码示例3
-- 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)