Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mysql copy entire column to a new one

Posted on 2016-09-23
3
Medium Priority
?
65 Views
Last Modified: 2016-09-23
what is the sql sentence to copy a column to the a new coloumn?
I want to create a copy of a column
0
Comment
Question by:Braveheartli
[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
3 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 41812509
>>what is the sql sentence to copy a column to the a new coloumn?
>>I want to create a copy of a column

ceate a new column first and then use an update query.
0
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 2000 total points
ID: 41812514
for example:
ALTER TABLE yourTable ADD newCol VARCHAR(250);

Open in new window

then:
Update yourTable Set newCol = oldCol;

Open in new window

0
 
LVL 1

Author Closing Comment

by:Braveheartli
ID: 41812618
thank you
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
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

715 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