DIV (Lakehouse v1)
Devolve o quociente da divisão do primeiro número pelo segundo, arredondando por defeito para o inteiro menor mais próximo. Equivalente ao operador de divisão //.
Ver também:
Sintaxe SQL
Seção intitulada “Sintaxe SQL”func.div(<numerator>, <denominator>)Exemplos do Analyze
Seção intitulada “Exemplos do 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)`Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”<number1> DIV <number2>Aliases
Seção intitulada “Aliases”Exemplos SQL
Seção intitulada “Exemplos 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)`