REGR_COUNT()

Aggregate. Returns an integer that represents the number of non-NULL number pairs used to fit the regression line.

Syntax

REGR_COUNT( dependent-expression , independent-expression )

Parameters
dependent-expression The variable that is affected by the independent variable.
independent-expression The variable that influences the outcome.

This function returns a LONG as the result.

SQL/2003 SQL foundation feature (T621) outside of core SQL.

The following example returns the number of non-NULL pairs that were used to fit the regression line.

With a GROUP BY clause:
SELECT REGR_COUNT()( Salary, ( 2008 - YEAR( BirthDate ) ) ) 
FROM Employees
group by depart_ID
With a window:
SELECT REGR_COUNT()( Salary, ( 2008 - YEAR( BirthDate ) ) ) 
FROM Employees
KEEP 10 ROWS