• shaini.binu (1/14/2010)


    Hi Lutz,

    Thanks for the quick reply,

    Regarding the requirement ,

    In LinkTable , ID1 contains the uniqueid of a transaction and ID2 contans the uniqueid of the transaction related to it,

    One transaction can be related to 0 or many transactions,

    We are in the process of creating specific groups for all related transaction.

    [font="Arial Black"]Quote: Am I right that you'd need to start a new group as soon as neither one of the numbers in one row has been previously assigned to a group?

    Ans: Yes, you are correct ,[/font]

    Quote:If so, how would you handle row 6 to be "6 | 101 | 104" instead of "6 | 106 | 104" (both values in a row are preassigned, but to different groups)?

    Are the groups supposed to be consecutive or can you "jump back" to let's say group 1 if row 8 would be 8 | 101 | 109?

    Ans :

    If the linktable contains data :

    SID(primary key)|ID1 |ID2

    ====================

    1| 101 | 102

    2| 102 | 101

    3| 103 | 104

    4| 103 | 105

    5| 104 | 105

    6| 101 | 104

    7| 107 | 108

    8| 101 | 109

    The expected output is:

    GroupNum| ID

    ==========

    1| 101

    1| 102

    1| 103

    1| 104

    1| 105

    2| 107

    2| 108

    1| 109

    Thanks & Regards

    Sh.

    Then why doesn't 103, 104, and 105 live in a group 2 by themselves?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)