Let's say you have the following
Acct# Amount
1122 300
1122 300
1122 500
How do I write a SUM on Amount and tell it not to add both 300, just one of them with the 500? So basically I'm treating any amounts with the same value as one unique amount then adding it to other unique amounts. The problem is whoever designed this 3rd party database were stupid. So I am left with this problem of ensure I don't get 300 + 300 + 500, just 300 + 500
I've already tried DISTINCT on Amount but that doesn't work.
Acct# Amount
1122 300
1122 300
1122 500
How do I write a SUM on Amount and tell it not to add both 300, just one of them with the 500? So basically I'm treating any amounts with the same value as one unique amount then adding it to other unique amounts. The problem is whoever designed this 3rd party database were stupid. So I am left with this problem of ensure I don't get 300 + 300 + 500, just 300 + 500
I've already tried DISTINCT on Amount but that doesn't work.