I Have table like
CustName | GroupName | Joining Date |
AAAA | G1 | 1-Jan-00 |
BBBB | G2 | 1-Feb-06 |
CCCC | G3 | 1-Mar-08 |
DDDD | G1 | 1-Mar-10 |
EEEEE | G2 | 1-Mar-11 |
I have to develop report displaying customer relationship length in years(current date - joining date) as follows
0-5 | 5-10 | 10-15 | |
G1 | 1 | 0 | 1 |
G2 | 1 | 1 | 0 |
G3 | 0 | 1 | 0 |
can we acheive it single sql query?