show column
SHOW COLUMNS FROM table_name;
insert column
ref: mysql-add-column
ALTER TABLE tb_name
ADD COLUMN new_col type FIRST|AFTER col_name;
--------------------------------------------------------
ex:
1.
ALTER TABLE vendors
ADD COLUMN phone VARCHAR(15) AFTER name;
2.
ALTER TABLE vendors
ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY FIRST name;
沒有留言:
張貼留言