DATE_SUB
Subtract the time interval or date interval from the provided date or date with time (timestamp/datetime).
Syntax
DATE_SUB(<unit>, <value>, <date_or_time_expr>)
Arguments
Return Type
The function returns a value of the same type as the <date_or_time_expr> argument.
Examples
SELECT date_sub(YEAR, 1, to_date('2018-01-02'));
┌──────────────────────────────────────────┐
│ date_sub(year, 1, to_date('2018-01-02')) │
├──────────────────────────────────────────┤
│ 2017-01-02 │
└──────────────────────────────────────────┘