T-SQL Select Statement Without a cursor

I have a total set of records of 1036, I need to find an even range distribution by 6

So without a cursor, how do I get this result.  

1:              1      1036
2:      1037      2073
3:      2074      3110
4:      3111      4147
5:      4148      5184
6:      5185      6221

The second set of numbers is always adding 1036 in order for all 6 records to have even distribution of 1036.
I can do this with a cursor, I can also do it without a cursor and using several parameters, but I wanted to know if this could be done with just one select statement
yanci1179Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Arifhusen AnsariBusiness Intelligence Developer and AnalystCommented:
Try this ..



;with testcte as (

select 1 [First] ,1036 [Second]

union all
select testcte.[Second]+1,testcte.Second+1+1036 from testcte
where testcte.First < 5185
 )

select * from testcte

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yanci1179Author Commented:
Thanks!  one more thing....how would I get the 1,2,3, 4,5,6 part?

1:              1      1036
 2:      1037      2073
 3:      2074      3110
 4:      3111      4147
 5:      4148      5184
 6:      5185      6221
Scott PletcherSenior DBACommented:
SELECT NTILE(6) OVER(ORDER BY id) AS group#, id
FROM dbo.table_name
Vitor MontalvãoMSSQL Senior EngineerCommented:
yanci1179, do you still need help with this question?
yanci1179Author Commented:
Thank you both!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.