none
Get minimum/maximum values

    Question

  • I have a table with the following numbers

    1
    2
    3
    4
    5
    6
    7
    10
    13
    14
    15
    16
    17
    18
    25
    26
    27
    28
    29
    30
    32
    33
    34

    I need to have an output as shown below

    1-7
    10-10
    13-18
    25-30
    32-34
    Please help me urgently

    Thanks


    CRM Manager

    Sunday, January 19, 2014 10:51 PM

Answers

  • Hi,

    Please check the below link.

    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/4cb39830-e11e-4416-b9db-acbb4e1ed2a3/tsql-query-to-get-range-of-minmax-of-sequence-numbers?forum=transactsql


    Thanks Shiven:) If Answer is Helpful, Please Vote

    Monday, January 20, 2014 1:00 AM