?
Solved

Alter Table Statements

Posted on 2011-03-23
2
Medium Priority
?
335 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:Eaddy Barnes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Assisted Solution

by:JoeNuvo
JoeNuvo earned 800 total points
ID: 35196365
I don't think so.
You have to run update query after alter table.
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 1200 total points
ID: 35196386

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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question