Results 1 to 3 of 3

Thread: *RESOLVED* Copying data from database and assign new unique number

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384

    *RESOLVED* Copying data from database and assign new unique number

    I have a table that holds 5 fields, field1 is the unique number and field2-5 are the details.

    i.e. If I have a number cars, the same make and model, all details are the same except for the unique car number. So how can I copy the details from CAR001 to CAR002?
    Last edited by mel_flynn; Jun 26th, 2003 at 10:05 AM.
    Mel

  2. #2
    Hyperactive Member rplcmint's Avatar
    Join Date
    Jan 2001
    Location
    Stockton, CA
    Posts
    333
    Well, you could create the new car information...just inputting the new unique number...so fields 2 - 5 will be generic or null.

    Then go back and run an Update on this new unique number using the details that came from car1.

    UPDATE table1
    SET field2 = car1field2, field3 = carfield3, field4=car1field4, field5 = car1field5
    WHERE field1 = car2field2.

    I'm not sure how you create the unique number, but it seems that you would know this information already.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384
    Thanx rplcmint, will give it a go.
    Mel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width