I have a table tbl_version_history which has a primary key and an index.

Through this query I am able to create a copy tbl_version_history_copy with
all the index.

Just replace the stuff with yours and probably it will help.

create table `tbl_version_history_copy` ( primary key ( FLD_REG_NUM ) ,key
`NewIndex1` ( `FLD_REG_NUM`, `FLD_VERSION_CODE`, `FLD_ADD_DATETIME` ) )
select * from `tbl_version_history`

Rgds
Insane

----- Original Message -----
From: "David Yee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 15, 2002 11:40 PM
Subject: Copy table with column attributes


> Hi all.  What's the quickest way to copy a table so that all column
> attributes such as auto_increment and primary key along with all indexes
get
> copied over?  I like using:
>
> create table new_table select * from old_table
>
> But it doesn't copy any indexes or those special attributes I mentioned
over
> to the new table.  I know this can be done using mysqldump but I'm
wondering
> if there's something quicker (less involved).  Thanks.
>
> David
>
> ---------------------------------------------------------------------
> 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