I've got some data like this
=================================
COL A | COL B | COL C | VAL
=================================
5 | 6 | 3 | 2
2 | 6 | 3 | 3
5 | 6 | 3 | 4
5 | 6 | 1 | 5
What I want to do is total All the Value in Column VAL ONLY if the column Has Uniquq Value Combination.
In Above Case The Total is 2 + 3 + 5 = 10 The Third Row isn't counted because the combination of 5 6 3 is not unique.
I've tried GROUP BY COL A,COL B,COL C, it will result
=================================
COL A | COL B | COL C | VAL
=================================
5 | 6 | 3 | 2
2 | 6 | 3 | 3
5 | 6 | 1 | 5
The thing is I dont know how to get the total of it. I've tried WITH ROLLUP, somehow it makes the table messy.
Any help is Appreciated. Thanks.