📜  在 mysq 中添加列 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:06.194000             🧑  作者: 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)