DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: update

  1. #1
    Join Date
    Feb 2005
    Posts
    28

    update

    one of our client sent data in wrong columns

    like instead of column1 data he sent to column 2 and vice-versa


    is there any way i can update this data easily

    like update tablname set column1=column2 and column2=column1



    please let me know if it's possible

  2. #2
    Join Date
    Apr 2005
    Posts
    2
    You should program a script that:
    1) Copies the values of column 1 & column 2 into a temp table.
    2) Deletes de values from the original table.
    3) Copy from the temp table the values of column 1 and column 2 in the correct order.

    Advice, if you have a primary key associated to each row, make sure each column value corresponds to the primary key you have.

  3. #3
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    I've no db available to test . . . I suspect this could work:
    update tablname set column1=column2, column2=column1
    It's worth testing
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  4. #4
    Join Date
    Feb 2005
    Posts
    28
    thanks

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