How to obtain start and end values in a sequence grouped 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 answer via

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

    OP pls confirm version you are using is 2008.

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

  • Current Version I'm running is :

    Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86) Jul 9 2008 14:43:34 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

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

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