0

Is a SQL function exists to SUM some numbers in a column but only if they are different ?

Hadi
  • 34,224
  • 11
  • 61
  • 121

2 Answers2

4

You can use subqueries to achive this:

Select Sum(TBL.column) From
( Select distinct column From Table) as TBL
Hadi
  • 34,224
  • 11
  • 61
  • 121
1
SELECT SUM(DISTINCT(COLUMN_NAME)) FROM TABLE
uSeruSher
  • 790
  • 8
  • 26