List:General Discussion« Previous MessageNext Message »
From:mos Date:May 29 2004 8:29pm
Subject:Re: Transfer records from one table to another
View as plain text  
At 02:13 PM 5/29/2004, you wrote:

>I have database about national historical events and another one about world
>Here's the structure:
>National events (d: day  m: month a: year hecho: fact)
>| id    | d     | m     | a     |hecho  |
>World events (d: day  m: month y: year event: fact)
>| id    | d     | m     | y     | event |
>Now, I want to copy the records from National to World events, is it

         Well, if the column names are the same, why not just do a:

Insert into World_Events select * from National_Events;

         If the column names are different in the two tables, then supply a 
column list as in:

Insert into World_Events (d,m,amhecho) select d,m,amhecho from National_Events;

The latter is recommended if 'id' column is not to be copied.


>msc. tomas alberto ramirez.andujar
>webmaster - cejisoft - +5332 262451 /261410 universidad pedagogica jose
>marti. camaguey circunvalacion norte km 51/2 cp 74670. cuba
>tommie@stripped -
>Este mensaje ha sido analizado por MDaemon Antivirus v2.21.
>Instituto Superior Pedagógico de Camaguey, Cuba.
>MySQL General Mailing List
>For list archives:
>To unsubscribe:

Transfer records from one table to anothertommie ramirez.andujar29 May
  • Re: Transfer records from one table to anotherPeter Brawley29 May
  • Re: Transfer records from one table to anothermos29 May
  • Form + databasetommie ramirez.andujar23 Jun
    • RE: Form + databaseNic Skitt23 Jun
    • Re: Form + database / PHP survey + databaseJames E Hicks III23 Jun