Link to home
Start Free TrialLog in
Avatar of jsbx
jsbxFlag for Chile

asked on

Group by correlation

Hello,

Can you help me with this query please (ms sql 2005):

I have a table like this:

NUMBER
1
2
3
5
6
8
9
10
20
21
25
28
30
31

I want to get this:

START       END
1           3
5           6
8           10
20          21
25          25
28          28
30          31

thanks.
ASKER CERTIFIED SOLUTION
Avatar of Russ Suter
Russ Suter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jsbx

ASKER

Sorry Russ, I shopuld have posted my real table names since i dont know how to translate your example to my actual table:

my table is called DTE_Inbox
and the column with the numbers is named Folio and it's the 5th column from left to right
Replace Sequence with DTE_Inbox.
Replace NumericValue with Folio.
Avatar of jsbx

ASKER

Thank you russ it worked perfectly.
Thank you Sharath for the clarification