DIV (Lakehouse v1)
Devuelve el cociente de dividir el primer número entre el segundo, redondeando hacia abajo al entero menor más cercano. Equivale al operador de división //.
Consulte también:
Sintaxis de SQL
Sección titulada «Sintaxis de SQL»func.div(<numerator>, <denominator>)Ejemplos de Analyze
Sección titulada «Ejemplos de 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)`Sintaxis de Analyze
Sección titulada «Sintaxis de Analyze»<number1> DIV <number2>Ejemplos de SQL
Sección titulada «Ejemplos de 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)`