Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 75
  • Last Modified:

mysql copy entire column to a new one

what is the sql sentence to copy a column to the a new coloumn?
I want to create a copy of a column
0
Braveheartli
Asked:
Braveheartli
  • 2
1 Solution
 
Ryan ChongCommented:
>>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
 
Ryan ChongCommented:
for example:
ALTER TABLE yourTable ADD newCol VARCHAR(250);

Open in new window

then:
Update yourTable Set newCol = oldCol;

Open in new window

0
 
BraveheartliMarketingAuthor Commented:
thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now