📜  mysql 添加列 - SQL 代码示例

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

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