In SQLite, the Sum()
function accepts an optional DISTINCT
keyword that enables you to add just the distinct values in the group. That is, it removes any duplicates from its calculation.
So if there are say, three rows that contain 10, only one of those rows will be included in the results.
Continue reading