[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Mar 2004 ]

RE: [edlug] MySQL copy table structure




CREATE TABLE <new table> SELECT * FROM <table> WHERE 1=0

will create an empty copy of your original table.

Gary


> -----Original Message-----
> From:	Catriona & Anand [SMTP:trianand@xxx.xxx.xxx]
> Sent:	Tuesday, March 02, 2004 1:57 PM
> To:	edlug@xxx.xxx.xxx
> Subject:	[edlug] MySQL copy table structure
> 
> 
> Hello all,
> 
> I am new to MySQL and am picking up the syntax as I go along. Right now, I
> 
> need to create a table with the same structure as an existing one. The
> manual 
> does not seem to offer a way to do this. In dBase there was a "COPY 
> STRUCTURE" command, but I can't find an equivalent.
> 
> Anand
> -
> ----------------------------------------------------------------------
> You can find the EdLUG mailing list FAQ list at:
> http://www.edlug.org.uk/list_faq.html
-
----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble@morpheux.org.DONTSPAMME
homepage