1 Reply Latest reply on Mar 19, 2007 5:02 PM by smokingapipe

    sum() returning null?

    smokingapipe

      I'm doing an EJB query, where I'm getting the sum of a value of some objects. If that query doesn't match any objects (rows), the value being returned is null. Does this make sense, or is there some other problem in my query?

        • 1. Re: sum() returning null?
          smokingapipe

          I did some experiments with some more queries, and indeed, it looks like if you take the sum() of an empty set of objects you get null, not zero. I just checked it and I get the same behavior in SQL itself.