skip to Main Content

I’m starting to study MySQL and I found in one of my resources the use of the command:

Alter table tableName modify(....)

Instead of using ‘modify column’
It it valid to use it and if it’s I want some.

I tried to search about it but I found nothing. The only information is that could be an older version

2

Answers


  1. If you look at the alter table documentation, you’ll see that when using the modify directive, the column keyword is optional:

    | MODIFY [COLUMN] col_name column_definition
            [FIRST | AFTER col_name]
    

    In layman’s terms – you can either use it or not, it makes no difference.

    Login or Signup to reply.
  2. If I understand the question correctly, it looks like you’re wondering if you can skip the keyword COLUMN

    It appears the correct syntax is
    MODIFY COLUMN column_name datatype;

    see alter/modify

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search