JustATheory
IS-IT--Management
Greetings,
Is it possible to use CASE to create a two column pivot, PIVOT is not an option with the database I'm working with. I need the count of Txn and the sum of Amount. Is it possible without Union All?
Original Table
Account Txn Amount
123 111 $10.00
456 222 $15.00
789 333 $20.00
234 111 $25.00
567 222 $30.00
891 333 $35.00
Results Table
Account TXN 111 Amt 111 TXN 222 Amt 222
123 1 $10.00
456 1 $15.00
234 1 $25.00
567 1 $30.00
Any help is greatly appreciated, thanks in advance.
JustATheory
Is it possible to use CASE to create a two column pivot, PIVOT is not an option with the database I'm working with. I need the count of Txn and the sum of Amount. Is it possible without Union All?
Original Table
Account Txn Amount
123 111 $10.00
456 222 $15.00
789 333 $20.00
234 111 $25.00
567 222 $30.00
891 333 $35.00
Results Table
Account TXN 111 Amt 111 TXN 222 Amt 222
123 1 $10.00
456 1 $15.00
234 1 $25.00
567 1 $30.00
Any help is greatly appreciated, thanks in advance.
JustATheory