Skip to content

REGR_COUNT

  • y: This is the dependent variable in the regression equation. It is the variable whose values will be predicted or explained in relation with another variable, referred to as X in this function.
  • x: This is the independent variable in the regression equation. It is the variable that is used to predict or explain changes in the dependent variable, Y, in this function. This is the variable that is manipulated to see if it has an effect on Y.
SELECT REGR_COUNT(salary, commission_pct) OVER () AS regr_count
FROM employees;
REGR_COUNT
----------------
14

The REGR_COUNT function returns the number of non-null pairs of numbers in a group. In this example, it returns the count of non-null pairs of salary and commission_pct from the employees table.