Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Consecutive Numbers In a range

Status
Not open for further replies.

bmacbmac

IS-IT--Management
Jan 26, 2006
392
US
Hi,
I have a table with 100,000 rows of bigint numbers:


2005041330
2005041331
2005041332
2005041333
2005041334
2005041337
2005041338
2005041339
2005041341
2005041342
2005041343
2005041347
2005041350
2005041351
2005041352
2005041353

I am looking for a way I can group this list into ranges... like this:
BegNumber EndNumber
2005041330 2005041334
2005041337 2005041339
2005041341 2005041343
2005041347 2005041347
2005041350 2005041353

This is for SQL 2000. Does anyone have an idea how I can go about this?

Thanks!

Brian
 
Thanks markros. That blog post was perfect!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top