How to obtain start and end value in a sequence grouping by another column value

  • Hi All,

    I have a requirement to obtain the start value and end value of a sequence based on a particular column.

    Ex:

    Serial Number - Reseller Name

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

    1001 RA01

    1002 RA01

    1003 RA01

    1004 RA01

    1005 RA02 --> This value changes in middle of sequence.

    1006 RA02

    1007 RA02

    1008 RA02

    1009 RA01 --> Again this value changes

    1010 RA01

    1011 RA01

    The requirement is to obtain the output for the reseller RA01 as:

    Start Val - End Val - Reseller Name

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

    1001 1004 RA01

    1009 1011 RA01

  • cross post,

    pls reply to http://qa.sqlservercentral.com/Forums/Topic629528-391-1.aspx

    no more cross posts pls op especially as you are using SQL 2008!

    ---------------------------------------------------------------------

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

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