How to change MySQL column definition?

后端 未结 3 532
清歌不尽
清歌不尽 2020-12-02 07:10

I have a mySQL table called test:

create table test(
    locationExpect varchar(120) NOT NULL;
);

I want to change the locationExpect colum

3条回答
  •  佛祖请我去吃肉
    2020-12-02 07:18

    Syntax to change column name in MySql:

    alter table table_name change old_column_name new_column_name data_type(size);
    

    Example:

    alter table test change LowSal Low_Sal integer(4);
    

提交回复
热议问题