Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Calculation with some aggregate functions results in null
Tue, Aug 26 2008 8:37 AMPermanent Link

Heiko Knuettel
SELECT
  AVG(field)+1,
  STDDEV(field)+1,
  RUNSUM(field)+1,
  MIN(field)+1,  
  MAX(field)+1,
  COUNT(field)+1,
  SUM(field)+1
FROM table

AVG, STDDEV and RUNSUM always result in null. The rest works.

Heiko
Wed, Aug 27 2008 1:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

<< SELECT
  AVG(field)+1,
  STDDEV(field)+1,
  RUNSUM(field)+1,
  MIN(field)+1,
  MAX(field)+1,
  COUNT(field)+1,
  SUM(field)+1
FROM table

AVG, STDDEV and RUNSUM always result in null. The rest works. >>

This is now fixed for the next build.  The issue is that the binary +1
expression is being evaluated prior to the AVG() being evaluated, thus
resulting in the NULL.  This basically causes any of the aggregates that
work on the basis of a calculation (AVG=SUM/COUNT) to have this issue.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image