Friday, June 1, 2012

Learning MySQL: Part 7

Rename column (can also be used to change column datatype):

mysql> alter table book change column old_col_name new_col_name col_type;
Note that the column type is mandatory!

Reset a sequence:

mysql> alter table table_name auto_increment = 1000;

No comments:

Post a Comment