Ok i'm sure this is a fairly straightforward question but Imagine this scenario:
Cust ID Acct num
1 1
1 2
1 3
2 4
2 5
3 6
4 7
I want to get one row per customer ID and pivot the acct num so that you get first, 2nd, 3rd, acctnum:
Cust ID Acc1 Acc2 Acc3
1 1 2 3
2 4 5
3 6
4 7
Get it?
Well i can't find an easy way of doing it in SQL. I'm primarily a SAS programmer and can do it easy in that but don't want to have to start exporting the data, modifying it and putting it back.
Cheers
Cust ID Acct num
1 1
1 2
1 3
2 4
2 5
3 6
4 7
I want to get one row per customer ID and pivot the acct num so that you get first, 2nd, 3rd, acctnum:
Cust ID Acc1 Acc2 Acc3
1 1 2 3
2 4 5
3 6
4 7
Get it?
Well i can't find an easy way of doing it in SQL. I'm primarily a SAS programmer and can do it easy in that but don't want to have to start exporting the data, modifying it and putting it back.
Cheers