grouping data with the same category

  • Hi can anyone help me on how I can group data by defining programatically a group number for a defined group of data using its parent_id. Here's how the data looks:

    PARENT_IDUNIQUE_ID
    100100
    100130
    100140
    100120
    100125
    100127
    100128
    200200
    200210
    200215
    300300
    300310
    300315

    Now what I want to do is group the data with the same parent_id programatically. The ouput should look like this:

    GROUPPARENT_IDUNIQUE_ID
    1100100
    1100130
    1100140
    1100120
    1100125
    1100127
    1100128
    2200200
    2200210
    2200215
    3300300
    3300310
    3300315

    Please help or any suggestion how I can do this. Thanks.

  • I think the DENSE_RANK function is what you're looking for.

    John

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

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