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

Re: [edlug] MySQL copy table structure



Thanks,

"AS SELECT" does just what I need. I will have to look into mysqldump, which 
seems a little high powered for my present needs, but could be useful later.

Anand

On Tuesday 02 March 2004 14:13, Lee Kindness wrote:
> 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