Try

1) create table c as select a,b as b1,b as b2 ... from a
2) drop a;
3) alter table c rename to a;

Instead of 2) you can rename the table and drop later, or tar-up the
.MYI,.MYD and .frm files for the table before doing the above.

Regards,
Dan


> -----Original Message-----
> From: Keith A. Calaman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 13 February 2002 5:08 a.m.
> To: Max Mouse; [EMAIL PROTECTED]
> Subject: RE: Columns
>
>
> Sounds like an UPDATE:
>
> http://www.mysql.com/doc/U/P/UPDATE.html
>
> UPDATE TABLE
> SET columnname1 = columnname2
> where KEY = KEY
>
> Something like that probably.  If it was me I would copy the
> whole table so
> I had a backup...UPDATES and DELETES can be destructive if writting
> improperly (*_*)
>
> -----Original Message-----
> From: Max Mouse [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 06, 2002 4:11 PM
> To: [EMAIL PROTECTED]
> Subject: Columns
>
>
> Hey all,
>
> Is it possible to copy the contents of one column to another column using
> mySQL? I just
> changed my table structure by adding a few more columns and I need to be
> able to move the data from the original column to 4 new columns and then
> drop the orginial. I know that the proper query for sql is that I
> added with
> ALTER and remove with DROP. But I can't find anything that would
> allow me to
> move the data from one column to another. Anything I can do?
>
> Max
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to