Modify column Vs change column

前端 未结 5 1134
南旧
南旧 2020-11-30 01:33

I know, we can not rename a column using modify column syntax,but can change column syntax.

My question is: what is the main usage of

5条回答
  •  猫巷女王i
    2020-11-30 02:24

    Change Column : Used when we want to change the column name with its definition. eg - alter table student CHANGE name full_name VARCHAR(32) NOT NULL;

    Modify column : Used when column name is to be same but change in its definition. eg - alter table student MODIFY full_name VARCHAR(64) NOT NULL;

    Rename column : Used when we only need to change the column name (its definition will be same) alter table student RENAME COLUMN full_name TO name;

提交回复
热议问题