David,

> I don't have a good example, but suppose I have a few tables with some
> fields each and I realize that I should make a new table with data
from
> some columns of some tables.  What to do?

Do you want to CREATE TABLE tbl_new SELECT (col1, col2, ...) FROM
tbl_old? Or do I miss something which would make it a more complicated
task?

If you don't want all rows from the source table you can use WHERE
and/or LIMIT.

Regards,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  Geschäftsführer / CEO iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

----- Original Message -----
From: "David T-G" <[EMAIL PROTECTED]>
To: "mysql users" <[EMAIL PROTECTED]>
Sent: Saturday, December 28, 2002 2:37 AM
Subject: altering data structure


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi, all --
>
> What's the best way to change your database schema around if you have
> data in it?  How do you know when to simply ALTER TABLE and when to
dump
> the whole thing (perhaps doing specific SELECTs to spit out the data
> you'd like to have in the end to be processed by some script that will
> make the new table structure)?
>
> I don't have a good example, but suppose I have a few tables with some
> fields each and I realize that I should make a new table with data
from
> some columns of some tables.  What to do?
>
>
> TIA & HAND & Happy Holidays
>
> mysql query,
> :-D
> - --
> David T-G                      * There is too much animal courage in
> (play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
> (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and
Health"
> http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (FreeBSD)
>
> iD8DBQE+DQB2Gb7uCXufRwARAoiYAJ9ImPYzudn5iVy6a2VaxF9hZpT0QQCgm5A8
> V9U37FV1f/Xk6VVRbPa8A9I=
> =XKu3
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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