Assigning Group ID

  • This problem can of course be solved using a loop, but loops are so repulsive

    Assume a table with the following columns:

    RowID - this is a unique value

    MyValue - this is some kind of non-predictable data 

    GroupID - this is the value we want to set.

    What I want to do is to assign the same group ID to all the rows that has the same MyValue. Remember that MyValue is not predictable.

    /HL

  • When I simplyfied the table this way I realized that the solution is rather obvious. I'll create a new table insert the distinct MyValue values and generate the group ID with an identity column or something. Then I'll update the original table.

    /HL

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply