Subject | Re: SUM and null values |
---|---|
Author | kokok_kokok |
Post date | 2011-11-25T12:01:50Z |
I cannot find information about if it is possible to build a UDF for aggregate functions. It would be my optimal solution.
However I have an alternative using SQL:
SELECT IIF(COUNT(*)-COUNT(Weight)>0, NULL, SUM(Weight)) FROM Persons
It works fine but it is not optimal. It needs to read too many records.
If somebody can think a more efficient solution, it would be great.
Thank you
However I have an alternative using SQL:
SELECT IIF(COUNT(*)-COUNT(Weight)>0, NULL, SUM(Weight)) FROM Persons
It works fine but it is not optimal. It needs to read too many records.
If somebody can think a more efficient solution, it would be great.
Thank you