DIV(Lakehouse v1)
最初の数を 2 番目の数で割った商を、より小さい最も近い整数に切り捨てて返します。除算演算子 // と同等です。
関連項目:
SQL 構文
Section titled “SQL 構文”func.div(<numerator>, <denominator>)Analyze の例
Section titled “Analyze の例”# Equivalent to the division operator "//"func.div(6.1, 2)
┌───────────────────────────────┐│ func.div(6.1, 2) │ (6.1 // 2) │├──────────────────┼────────────┤│ 3 │ 3 │└───────────────────────────────┘
# Error when divided by 0error: APIError: ResponseError with 1006: divided by zero while evaluating function `div(6.1, 0)`Analyze 構文
Section titled “Analyze 構文”<number1> DIV <number2>SQL の例
Section titled “SQL の例”-- Equivalent to the division operator "//"SELECT 6.1 DIV 2, 6.1//2;
┌──────────────────────────┐│ (6.1 div 2) │ (6.1 // 2) │├─────────────┼────────────┤│ 3 │ 3 │└──────────────────────────┘
SELECT 6.1 DIV 2, INTDIV(6.1, 2), 6.1 DIV NULL;
┌───────────────────────────────────────────────┐│ (6.1 div 2) │ intdiv(6.1, 2) │ (6.1 div null) │├─────────────┼────────────────┼────────────────┤│ 3 │ 3 │ NULL │└───────────────────────────────────────────────┘
-- Error when divided by 0root@localhost:8000/default> SELECT 6.1 DIV 0;error: APIError: ResponseError with 1006: divided by zero while evaluating function `div(6.1, 0)`