SQL Query : Copy one Column to another column in MySQL
by Gabi SolomonI wanted to do add a new column to a table and to copy the values from that a diferent to column ( from the same table ) to the new column. And even though i thought of very integrates query’s at first, the solution was quite simple
( as always ).
[SQL]
ALTER TABLE `table_name` ADD `new_column` TEXT NOT NULL;
UPDATE `table_name` SET `new_column` = `old_column`;
[/SQL]
Nice and simple.
Cheers
Related Posts
Related Posts
-
http://askbahar.com Habib Ullah Bahar
-
http://www.cutmyhair.com.au/ hairdresser
-
VENKATESH_V_S
-
http://TedAvery.ca Ted Avery
-
Thedigitalblade
-
http://twitter.com/legendri Robertino Darmati
-
User
-
Rajeev Bu
-
http://www.modularhomesnetwork.com Modular Home
-
http://www.findprefab.com Prefab Home
-
http://twitter.com/_maars Andrey Nemchenko
-
Vivek Kapoor
-
http://www.findprefab.com Manufactured House
-
http://www.findprefab.com/ Prefab Home
-
Balakarthikeyan07
-
http://www.modularhomesnetwork.com/ Modular Homes
-
http://www.modularhomesnetwork.com/ Manufactured Homes
-
Anonymous
-
http://www.modularhomesnetwork.com/ Modular Homes
-
http://www.modularhomesnetwork.com/ Modular Homes
-
Rob
-
Gopal, Mumbai
-
Deepak Jain
-
Deepak Jain
-
C0d3M0nk3y
-
Farhanali89
-
User
-
http://vouch2go.com/ Yaniv
-
Jayapalagowda
-
Mihai

