A table, field below
Id, shop_Id, member_Id, num
Have the same id and shop_Id uniqueness, member_Id
Now I want to use an SQL statement finds out each of the data and calculate the same total number of num member_id
How can I do?
CodePudding user response:
Now the environment is far better than I give the problem of complex, I simplified the problem, the key question
CodePudding user response:
SELECT id, shop_id, member_Id, SUM (num) AS sum_num
FROM the table name
GROUP BY id, shop_id, member_Id
I understand it is a group by ah, not so complicated, I don't know right
CodePudding user response: