Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    34

    Unanswered: update and function in same table

    hi,

    this is probably straightforward question: i want to update my table by performing a function on name_ID field and saving it as ID_encryp field, namely by encrypting it; but i'm also interested in the bigger question of how to do a function on a field and save it in another field in mysql.

    the next question is where to start to get the SQL code to go through the table and perform the function on each row, saving the result in the ID_encrypt field.

    sorry, i know this is probably pretty basic.

    all help appreciated.

    mike

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    update daTable
       set ID_encryp = somefunction(name_ID)
    will update all rows
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2007
    Posts
    34
    thanks r937. it was just what i needed . . .

Posting Permissions

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