Aggregate. Computes the y-intercept of the linear regression line that best fits the dependent and independent variables.
REGR_INTERCEPT( dependent-expression , independent-expression )
dependent-expression | The variable that is affected by the independent variable. |
independent-expression | The variable that influences the outcome. |
AVG( x ) - REGR_SLOPE( x, y ) * AVG( y )
SQL/2003 SQL foundation feature (T621) outside of core SQL.
The following example returns the y-intercept of the linear regression line.
SELECT REGR_INTERCEPT()( Salary, ( 2008 - YEAR( BirthDate ) ) ) FROM Employees group by depart_IDWith a window:
SELECT REGR_INTERCEPT()( Salary, ( 2008 - YEAR( BirthDate ) ) ) FROM Employees KEEP 10 ROWS