Home > T-SQL > SQL SERVER – SQUARE() – Math Functions @SQLSERVER

SQL SERVER – SQUARE() – Math Functions @SQLSERVER


SQUARE () function returns the square of a float expression given in the function argument. The return type of this function is float.

\square is a geometry symbol to denotes square.

Syntax

SQUARE ( float expression )

Example

–Square a positive number
select square (3)
Output: 9
 
–Square a negative number
select square (-3)
Output: 9
 
–Square a decimal number
select square (0.25)
Output: 0.0625
 

Square of a value x can be represented  as (x * x). So, we can also use this method in our program. Built-in functions are useful to developers to build application easier and more readable.

Thanks for Reading.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: