Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2014

    renumbering in SQL DB2

    I have a problem with SQL DB2. Here it is:

    I have a table that contains data like:
    1 Henry
    2 Kate
    3 Any other name

    Now there is a new name for record 2, Leo. I want to insert this record into the table with the next result:
    1 Henry
    2 Leo
    3 Kate
    4 Any other name

    So I want SQL insert the new record for Leo and renumber the following names as you can see in the example.

    Does any one knows how to do this?

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    What determines the sequence? If the rows can go in arbitrary order then the answer is simple. Without knowing what your criteria are, I'm not willing to waste time dreaming up answers.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Tags for this Thread

Posting Permissions

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