Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132

    Unanswered: transfer/move records from field to field

    hi,
    anyone knows how to move/transfer records from field1 to field 2?


    thanks
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    update mytable set field2=field1
    should do the trick.. unless you want to transpose fields ie field1.oldvaule->field2 and field2.oldvalue to field1
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132
    great!
    but, what do you mean by transpose? can it delete records from field1 and copy it to field2? bcause after i copy the field1 to field2 i will delete it from field1. its like moving the records.

    thanks
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you can simply manipulate data using SQL. however if you want to move the value of field 1 to filed 2, and the value of field 2 to field 1 (ie transpose the values in field 1 to field2) in one operation you would need some other mechanism...

    if you want to blank field 1 you could
    update mytable set field2=field1, field1=""
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by homer.favenir
    hi,
    anyone knows how to move/transfer records from field1 to field 2?
    this is impossible

    fields don't have records
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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