I have a table that contians charges per account.
There can be up to say 6 charges max per account.
Here is a simple query to pull back one account.
and the results would look like
Account_Num CTP
1 11111
1 22222
1 33333
1 44444
Is there a way to put a number by each charge, and then reset per account.
Account_Num CTP Number
1 11111 1
1 22222 2
1 33333 3
1 44444 4
My end goal is to get all the charges in one line so the header would be like
Account_Num, CPT1,CPT2,CTP3,CPT4
I figured if i could get the counter next to each charge i could use a group by and a set of cases put this into one line.
Any ideas would be great.
Thanks
There can be up to say 6 charges max per account.
Here is a simple query to pull back one account.
Code:
Select Account_Num,CPT From Charges
WHERE Account_Num=1
and the results would look like
Account_Num CTP
1 11111
1 22222
1 33333
1 44444
Is there a way to put a number by each charge, and then reset per account.
Account_Num CTP Number
1 11111 1
1 22222 2
1 33333 3
1 44444 4
My end goal is to get all the charges in one line so the header would be like
Account_Num, CPT1,CPT2,CTP3,CPT4
I figured if i could get the counter next to each charge i could use a group by and a set of cases put this into one line.
Any ideas would be great.
Thanks