From Table
A   B
_______________
1   A
3   B
6   C
7   C
8   X   
9   Y
15  Z
16  R
17  t   
23  T
43  e
How to bring this result:
Range A  Count B
_________________
1-10    6
11-20   3
21-30   1
31-40   1
This could be done using loop:
Select Count (* ) from TableA where b between @a and @b
But I would like to do it without using any loop is it possible?
 
     
    