Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL REGR_COUNT Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: REGR_COUNT

Definition:
In Oracle PL/SQL, the function REGR_COUNT is a linear regression analytic function which takes two numeric inputs and counts the number of pairs in which the value of both of the arguments is NOT NULLNULL.

Example Syntax:

REGR_COUNT(x,y)


In the syntax, 'x' is referred to as the dependent variable and 'y' is referred to as the independent variable of the Regression Line.

Example Usage:

The SQL query below uses REGR_COUNT to count the NOT NULL pairs of SAL and DEPTNO in the EMPLOYEE table.

sql> SELECT deptno, sal, regr_count(sal, deptno) OVER (partition by deptno) "REGR_COUNT"
FROM employee
/

DEPTNO SAL REGR_COUNT
----------- ---------- ----------
100 2300 5
100 3810 5
100 3810 5
100 8300 5
100 5
100 2300 5
110 3900 3
110 8210 3
110 2900 3
120 4500 4
120 8300 4
120 1200 4
120 3200 4

13 rows selected.



Related Links:

Related Code Snippets:
  • REGR_COUNT - REGR_COUNT Returns the number of non-null numbers used to fit the regression line. ...
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 67 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?