http://dev.mysql.com/doc/refman/5.0/en/create-table.html

under MySQL 5.0 you can do this:
CREATE TABLE mynewtable LIKE theotherone;
-- this will copy the structure as well as add idexes identical to
the plan in the original


under any earlier 4.x version, this will work too
CREATE TABLE mynewtable SELECT * from theotherone WHERE 1 = 0;
- - this will create the structure, but leave the result without
indexes, so be careful and double check if you use this latter
technique

- michael

On 5/23/07, J Trahair <[EMAIL PROTECTED]> wrote:
Hi Everyone

Is there a way of replicating or cloning the structure of an existing table and 
giving it a different name? I have a table of items on sale in the shops, I 
want to create a table of items not yet in the shops but due to be introduced 
very soon.

MySQL 5.0.37 Windows XP.

Thanks in advance.

Jonathan Trahair


--
- michael dykman
- [EMAIL PROTECTED]

- All models are wrong.  Some models are useful.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to