Zum Inhalt springen

Wandelt eine angegebene Anzahl von Monaten in den Typ Interval um.

  • Akzeptiert positive Ganzzahlen, null und negative Ganzzahlen als Eingabe.
func.to_months(<months>)
func.to_months(2)
┌──────────────────────────────────────────────────────┐
│ func.to_months(2) │
├──────────────────────────────────────────────────────┤
│ 2 months │
└──────────────────────────────────────────────────────┘
TO_MONTHS(<months>)

Interval (in Monaten dargestellt).

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 │
└──────────────────────────────────────────────┘