REGR_SXX Function Example | Teradata Vantage - Example: Returning the Sum of Squares for Height - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

This example is based the following regrtbl data. Nulls are indicated by the QUESTION MARK character.

c1   height   weight
--   ------   ------
 1       60       84
 2       62       95
 3       64      140
 4       66      155
 5       68      119
 6       70      175
 7       72      145
 8       74      197
 9       76      150
10       76      ?
11       ?       150
12       ?       ?

The following SELECT statement returns the sum of squares for height where neither height nor weight is null.

SELECT REGR_SXX(weight,height) 
FROM regrtbl;

Result:

Regr_Sxx(weight,height)
-----------------------
                    240