Zum Inhalt springen

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

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

Interval (in Jahren dargestellt).

SELECT TO_YEARS(2), TO_YEARS(0), TO_YEARS((- 2));
┌───────────────────────────────────────────┐
│ to_years(2) │ to_years(0) │ to_years(- 2) │
├─────────────┼─────────────┼───────────────┤
│ 2 years │ 00:00:00 │ -2 years │
└───────────────────────────────────────────┘