Squaring a value in Teradata

Database
Enthusiast

Squaring a value in Teradata

Hello. I'm currently trying to calculate BMI in TERADATA using weight (lbs) and height (in). In Sql server, the code to calculate the BMI is following: BMI=( (WEIGHT_LBS*703)/(square(HEIGHT_INCHES ) )) But, I wonder what the TERADATA equivalent of this code. In particular, if there is function similar to the square function in SQL server? Thanks.

Accepted Solutions
Junior Contributor

Re: Squaring a value in Teradata

There's no SQUARE function, but it's a very basic calculation:

(HEIGHT_INCHES * HEIGHT_INCHES)

HEIGHT_INCHES ** 2

POWER(HEIGHT_INCHES, 2)

Of course you could create a SQL UDF based on that.

1 ACCEPTED SOLUTION
2 REPLIES
Junior Contributor

Re: Squaring a value in Teradata

There's no SQUARE function, but it's a very basic calculation:

(HEIGHT_INCHES * HEIGHT_INCHES)

HEIGHT_INCHES ** 2

POWER(HEIGHT_INCHES, 2)

Of course you could create a SQL UDF based on that.

Enthusiast

Re: Squaring a value in Teradata

Thank you for the quick replied back.