TO_QUARTER (Lakehouse v1)
Obtém o trimestre (1, 2, 3 ou 4) de uma data ou timestamp fornecido.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.to_quarter(<expr>)Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.now(), func.to_quarter(func.now()), func.quarter(func.now())
┌─────────────────────────────────────────────────────────────────────────────────────┐│ func.now() │ func.to_quarter(func.now()) │ func.quarter(func.now()) │├────────────────────────────┼─────────────────────────────┼──────────────────────────┤│ 2024-03-14 23:32:52.743133 │ 3 │ 3 │└─────────────────────────────────────────────────────────────────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”TO_QUARTER( <date_or_time_expr> )Aliases
Seção intitulada “Aliases”Tipo de retorno
Seção intitulada “Tipo de retorno”Inteiro.
Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT NOW(), TO_QUARTER(NOW()), QUARTER(NOW());
┌─────────────────────────────────────────────────────────────────┐│ now() │ to_quarter(now()) │ quarter(now()) │├────────────────────────────┼───────────────────┼────────────────┤│ 2024-03-14 23:32:52.743133 │ 1 │ 1 │└─────────────────────────────────────────────────────────────────┘