SQUARE (Transact-SQL)
指定した浮動小数点値の 2 乗を返します。
適用対象: SQL Server (SQL Server 2008 から現在のバージョンまで) |
構文
SQUARE ( float_expression )
引数
- float_expression
float 型、または暗黙的に float 型に変換できる式を指定します。
戻り値の型
float
使用例
次の例では、半径が 1 インチで高さが 5 インチの円柱の体積を返します。
DECLARE @h float, @r float;
SET @h = 5;
SET @r = 1;
SELECT PI()* SQUARE(@r)* @h AS 'Cyl Vol';
以下に結果セットを示します。
Cyl Vol
--------------------------
15.707963267948966