Hi,
i have a table like this:
ID Priority Acct_no ICDCode
1 1 123 1.0
1 3 123 1.5
1 4 123 2.0
2 1 234 1.8
2 2 234 1.5
3 1 456 3.7
3 3 456 4.1
3 5 456 4.0
3 7 456 3.3
3 8 456 3.6
i need to insert into a table like this:
ID Acct_no P1 ICDCd1 P2 ICDCd2 P3 ICDCd3 P4 ICDCd4 P5 ICDCd5
1 123 1 1.0 3 1.5 4 2.0
2 234 1 1.8 2 1.8
3 456 1 3.7 3 4.1 5 4.0 7 3.3 8 3.6
there will always be max 5 priorities for each account. I think i can do this with a cursor (although i can't picture the syntax in my head). I wasn't sure if there was a set based way to do this to stay away from the cursor.
Anyone have any ideas??
thanks
Scott