I have created two table person with column id, name, mobile and another is transaction table with id, quantity, rate, total, pay, due, one person can have multiple entry in transaction table. Now, I want to see the total quantity, total payment and total due against each name in person table. I don't know much about sql, that's why I try for total quantity first but it give me error: "Error Code: 1241. Operand should contain 1 column(s)"
My sql is:
select id,name from person where(id) in
(select id, sum(quantity) from transaction group by id);
What can i do for, showing all field like: total quantity, total pay, total due.