aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/datetime2/test/cases/Shift.sql
blob: b421c5586832dad592fd472fa95089b8935b8621 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SELECT
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftYears(tm, 10)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftYears(tm, 10)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftQuarters(tm, 16)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftQuarters(tm, -16)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, 0)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, 1)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, 3)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, 11)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, 12)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, 123)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, -1)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, -3)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, -11)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, -12)) as String),
    cast(DateTime::MakeTzTimestamp(DateTime::ShiftMonths(tm, -123)) as String)
from (
    select
        cast(ftztimestamp as TzTimestamp) as tm
    from Input
);