Link to home
Create AccountLog in
Avatar of yanci1179
yanci1179

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of yanci1179
yanci1179

ASKER

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
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
yanci1179, do you still need help with this question?
Thank you both!