MYSQL TOTAL多个独特的列

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.

If the combination is not unique, which value do you choose? Remember, SQL tables represent unordered sets, so there is no notion of one row being before or after another.

According to your example, the following works:

select sum(val)
from (select a, b, c, min(val) as val
      from t
      group by a, b, c
     ) t;