0

how can I select in a Oracle DB all columns but some of them DISTINCT. I have columns A,B,C that I want distinct and column D that I want the sum of the rows.

A   B   C   D
1   2   3   10
1   2   3   20
1   2   4   1000

And I want the result

A   B   C   D
1   2   3   30
1   2   4   1000

Thanks!

3

It's easy-peasy:

select a,b,c,sum(d)
from yourtable
group by a,b,c;

Probably too simple for this site, to be honest.

Not the answer you're looking for? Browse other questions tagged or ask your own question.