I'm trying to count multiple columns in a select statement for a class I'm in.
Everything is coming from the same table. I want to know how many times that person paid something and how many times they received something.
There is an ID for each time something is given, but that same ID would be for when someone receives something. I was trying to do the following, but I keep getting Scalar Subquery produced more than one element.
Select Distinct A, Receiverid, Giver, C, D, sum (received amount) (Select Count(paidid) FROM Table WHERE A ='12345' GROUP BY Giver) as NumberGiven (Select Count(Receiverid) FROM Table WHERE A ='12345' GROUP BY Receiverid) as NumberReceived FROM Table WHERE A = '12345' Group By A, ReceiverID, Giver, C, D