Saturday, March 30, 2013

MySQL Change Column Name and Alter Column

-- Changing a Column Name

alter table courierJobAcceptanceTable RENAME tblcourierjobacceptence;

-- Modifying a Column Type


To change column a from INTEGER to TINYINT NOT NULL (leaving the name the same), and to change column bfrom CHAR(10) to CHAR(20) as well as renaming it from b to c:
ALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b c CHAR(20);

No comments:

Post a Comment