TO_QUARTER (Lakehouse v1)
Extrait le trimestre (1, 2, 3 ou 4) d’une date ou d’un horodatage donné.
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.to_quarter(<expr>)Exemples Analyze
Section intitulée « Exemples 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 │└─────────────────────────────────────────────────────────────────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »TO_QUARTER( <date_or_time_expr> )Type de retour
Section intitulée « Type de retour »Entier.
Exemples SQL
Section intitulée « Exemples SQL »SELECT NOW(), TO_QUARTER(NOW()), QUARTER(NOW());
┌─────────────────────────────────────────────────────────────────┐│ now() │ to_quarter(now()) │ quarter(now()) │├────────────────────────────┼───────────────────┼────────────────┤│ 2024-03-14 23:32:52.743133 │ 1 │ 1 │└─────────────────────────────────────────────────────────────────┘