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

[edlug] MySQL copy table structure



I believe "CREATE TABLE xxx AS SELECT ..." is the ANSI way to do
it. If you SELECT 0 rows you'll only get the structure (but probably
not indexes etc).

YMMV... Not a MySQL user myself... In PostgreSQL you've also got the
option of inheritance.

L.

Catriona & Anand writes:
 > 
 > 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