i want to add a new column noOfTry in a table which already have some columns. the column data will be integer type and default value will be 0. i know i need to use alter query, just asking for the correct format of the query for this case
+1
A:
alter table `database`.`table`
add column `noOfTry` int(11) DEFAULT '0' NULL after `column`;
where column is the column before the on you want to add if you want to add in the middle of the table but this is optional.
laurent-rpnet
2010-08-01 07:31:15
+1
A:
The simplest option would be
ALTER TABLE MyTable ADD COLUMN noOfTry INT NOT NULL DEFAULT 0;
Rowland Shaw
2010-08-01 07:31:55