I'm working with Microsoft SQL Server 2014. I have a table with next data format:
|customerId | action | amount | isSuccessful | paymentCount |
|____1____ |__ W__ |____10__|____0____ |_____2________|
|____1____ |__ D__ |____20__|____1____ |_____3________|
|____1____ |__ W__ |____30__|____1____ |_____1________|
|____1____ |__ D__ |____40__|____0____ |_____1________|
What I need is to do report with this format:
|customerId|depositAmount|withdrawalAmount|depositAttemptCount|withdrawalAttemptCount|
|____1____ |______20 ____|________30_____ |________4_______ _|________3__________ |
How it's possible to 'transform' table with select?
I would appreciate any help.