Search code examples
sqlprestotrino

Presto Trino Sql , select Date which is two days before


select  current_date as current_dated from table

select current_date - interval(2,days) as current_dated , is what I am looking for


Solution

  • There are multiple options, for similar syntax you can use interval '2' day, another option is date_add:

    select current_date - interval '2' day
        , date_add('day', -2, current_date)
    

    Output:

    _col0 _col1
    2022-06-02 2022-06-02