FLOOR (Transact-SQL)FLOOR (Transact-SQL)
適用対象:Applies to: SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
指定された数値式以下の最大の整数を返します。Returns the largest integer less than or equal to the specified numeric expression.
Transact-SQL 構文表記規則
Transact-SQL Syntax Conventions
構文Syntax
FLOOR ( numeric_expression )
注意
SQL Server 2014 以前の Transact-SQL 構文を確認するには、以前のバージョンのドキュメントを参照してください。To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
引数Arguments
numeric_expressionnumeric_expression
bit データ型を除く、真数または概数データ型カテゴリの 式 です。Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type.
戻り値の型Return Types
numeric_expression と同じ型を返します。Returns the same type as numeric_expression.
例Examples
この例では、正の数値、負の数値、および通貨値を使った FLOOR
関数を示しています。The following example shows positive numeric, negative numeric, and currency values with the FLOOR
function.
SELECT FLOOR(123.45), FLOOR(-123.45), FLOOR($123.45);
結果には、計算値と同じデータ型の整数部分 numeric_expression です。The result is the integer part of the calculated value in the same data type as numeric_expression.
--------- --------- -----------
123 -124 123.0000
例: Azure Synapse AnalyticsAzure Synapse Analytics、Parallel Data WarehouseParallel Data WarehouseExamples: Azure Synapse AnalyticsAzure Synapse Analytics and Parallel Data WarehouseParallel Data Warehouse
この例では、正の数値、負の数値、および FLOOR
関数を使用した値を示します。The following example shows positive numeric, negative numeric, and values with the FLOOR
function.
SELECT FLOOR(123.45), FLOOR(-123.45), FLOOR($123.45);
結果には、計算値と同じデータ型の整数部分 numeric_expression です。The result is the integer part of the calculated value in the same data type as numeric_expression.
----- --------- -----------
123 -124 123