TO_QUARTER (Lakehouse v1)
Obtiene el trimestre (1, 2, 3 o 4) de una fecha o marca de tiempo dada.
Sintaxis de Analyze
Sección titulada «Sintaxis de Analyze»func.to_quarter(<expr>)Ejemplos de Analyze
Sección titulada «Ejemplos de 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 │└─────────────────────────────────────────────────────────────────────────────────────┘Sintaxis de SQL
Sección titulada «Sintaxis de SQL»TO_QUARTER( <date_or_time_expr> )Tipo de valor devuelto
Sección titulada «Tipo de valor devuelto»Entero.
Ejemplos de SQL
Sección titulada «Ejemplos de SQL»SELECT NOW(), TO_QUARTER(NOW()), QUARTER(NOW());
┌─────────────────────────────────────────────────────────────────┐│ now() │ to_quarter(now()) │ quarter(now()) │├────────────────────────────┼───────────────────┼────────────────┤│ 2024-03-14 23:32:52.743133 │ 1 │ 1 │└─────────────────────────────────────────────────────────────────┘