Alter Table Statements

Hello Folks,

Is it possible to alter a table column , create a new column from the contents of an already existing Column..
e.g
ALTER TABLE `tb_name` ADD `new_column` VARCHAR( 250 ) FROM `tb_name` CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `old_column`  but i want all the contents from the old_column to be replicated to the new_column..

Thanks in advance
LVL 11
Eaddy BarnesITAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Pratima PharandeConnect With a Mentor Commented:

Youn need the aletr column to ad new column
andafter that you need to run update statement to move data to new column

Update `tb_name`
set `new_column`  = `old_column`
0
 
JoeNuvoConnect With a Mentor Commented:
I don't think so.
You have to run update query after alter table.
0
All Courses

From novice to tech pro — start learning today.