mysql - DISTINCT WITH SUM -
i have mysql join result looks this.
id | name | score | someid --------------------------- 1 | abc | 100 | 2 1 | abc | 100 | 2 1 | abc | 100 | 3 1 | abc | 100 | 3 1 | abc | 100 | 4 1 | abc | 100 | 4
i want result of join result in sum distinct like
id | name | sum(score) | someid --------------------------- 1 | abc | 200 | 2 1 | abc | 200 | 3 1 | abc | 200 | 4
is there possible solution problem! help?
try this:
select id, name, sum(score), someid tablea group id, name, someid;
Comments
Post a Comment