Answer the question
In order to leave comments, you need to log in
How can I sum up the points of people by teams?
There are two tables:
Team ID | User IDs |
---|---|
one | 15648984 |
one | 345934851 |
2 | 894894564 |
2 | 43958346 |
User IDs | User Points |
---|---|
15648984 | 12 |
345934851 | 34 |
894894564 | eight |
43958346 | 6 |
Team ID | Sum of points |
---|---|
one | 46 |
2 | fourteen |
Answer the question
In order to leave comments, you need to log in
It can be so.
SELECT id as 'ID Команды', SUM(User_points) as 'Сумма очков' FROM comandTabl
LEFT JOIN userTabl ON comandTabl.id_user = userTabl.id
GroupBy id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question