TO_MONTH (Lakehouse v1)
Convertit une date ou une date avec heure (horodatage/datetime) en nombre UInt8 contenant le numéro du mois (1-12).
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.to_month(<expr>)Exemples Analyze
Section intitulée « Exemples Analyze »func.now(), func.to_month(func.now()), func.month(func.now())
┌─────────────────────────────────────────────────────────────────────────────────┐│ func.now() │ func.to_month(func.now()) │ func.month(func.now()) │├────────────────────────────┼───────────────────────────┼────────────────────────┤│ 2024-03-14 23:34:02.161291 │ 3 │ 3 │└─────────────────────────────────────────────────────────────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »TO_MONTH(<expr>)Arguments
Section intitulée « Arguments »| Arguments | Description |
|---|---|
<expr> |
date/horodatage |
Type de retour
Section intitulée « Type de retour »TINYINT
Exemples SQL
Section intitulée « Exemples SQL »SELECT NOW(), TO_MONTH(NOW()), MONTH(NOW());
┌─────────────────────────────────────────────────────────────┐│ now() │ to_month(now()) │ month(now()) │├────────────────────────────┼─────────────────┼──────────────┤│ 2024-03-14 23:34:02.161291 │ 3 │ 3 │└─────────────────────────────────────────────────────────────┘