3 Replies Latest reply on Feb 7, 2008 5:38 AM by Dan Bracuk

    Copying data between tables

    matstone98
      I have just completed the process of exporting my companies main mailing database into a new database file which is setup and structured differently. I am trying to figure out how to run a coldfusion query that can update my contact information from one table into another, tables are as follows:

      companies table
      companyid | contacttitle1 | contactname1 | contactsurname1 | contactposition1 | mail1
      ------------------------------------------------------------------------------------------ ----------------------------------
      autonum | text | text | text | text | text

      AddxContacts table
      id | contacttitle1 | contactname1 | contactsurname1 | contactposition1 | mail1
      ------------------------------------------------------------------------------------------ ----------------------------------
      number | text | text | text | text | text

      i need to update the fields in the first table with the fields in the second table, the companyid & id from each table are the primary keys that match up the records, however the AddxContacts table may contain more than one entry with the same id no, but i only want to copy one record for each id no.

      I have scoured various forums looking for an easy way to do this but so far have come up blank, any help would be greatly appriciated. Thanks