0

I want to add new column in mysql table but condition is new column must same as other old column(same table).

like old column have int data type and its length is 5

i want to add new column but new column datatype and length must same as old column.

Vaibhav Jain
  • 493
  • 2
  • 7
  • 13

1 Answers1

1

You can add a column like this:

ALTER TABLE `table_name` ADD COLUMN `age2` INT;

The "length" doesn't matter. INT is INT. It's a common misconception that the argument to an INT type is some sort of "length" or "size". It's not.

See MySQL - Size Limits to Integer Columns

Community
  • 1
  • 1
Bill Karwin
  • 538,548
  • 86
  • 673
  • 828