TO_MONTHS (Lakehouse v1)
指定した月数を Interval 型に変換します。
- 入力には、正の整数、ゼロ、負の整数を指定できます。
Analyze の構文
Section titled “Analyze の構文”func.to_months(<months>)Analyze の例
Section titled “Analyze の例”func.to_months(2)┌──────────────────────────────────────────────────────┐│ func.to_months(2) │├──────────────────────────────────────────────────────┤│ 2 months │└──────────────────────────────────────────────────────┘TO_MONTHS(<months>)Interval(月で表されます)。
SELECT TO_MONTHS(2), TO_MONTHS(0), TO_MONTHS((- 2));
┌──────────────────────────────────────────────┐│ to_months(2) │ to_months(0) │ to_months(- 2) │├──────────────┼──────────────┼────────────────┤│ 2 months │ 00:00:00 │ -2 months │└──────────────────────────────────────────────┘