Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Unanswered: UPDATE SQL (DB2) with RAND function.

    Hi,
    Can someone please give me a UPDATE sql statement with RAND function in DB2. Basically I want to update one DB2 alphanumeric column with a random number. Appreciate your help.

    Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    UPDATE myTable
       SET myCharColumn = '42'
    This will set this column to a random number (42) for all rows.

    -PatP

  3. #3
    Join Date
    Nov 2004
    Posts
    7
    Thanks Pat. But I want to put a different random number for each row. This will just give a number on each and every row of that column. The number should be unique.

Posting Permissions

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