TO_DECADES (Lakehouse v1)
Converts a specified number of decades into an Interval type.
- Accepts positive integers, zero, and negative integers as input.
Analyze Syntax
Section titled “Analyze Syntax”func.to_decades(<decades>)Analyze Examples
Section titled “Analyze Examples”func.to_decades(2)┌──────────────────────────────────────────────────────┐│ func.to_decades(2) │├──────────────────────────────────────────────────────┤│ 20 years │└──────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_DECADES(<decades>)Return Type
Section titled “Return Type”Interval (represented in years).
SQL Examples
Section titled “SQL Examples”SELECT TO_DECADES(2), TO_DECADES(0), TO_DECADES((- 2));
┌─────────────────────────────────────────────────┐│ to_decades(2) │ to_decades(0) │ to_decades(- 2) │├───────────────┼───────────────┼─────────────────┤│ 20 years │ 00:00:00 │ -20 years │└─────────────────────────────────────────────────┘