aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/datetime/date_tz_compare_gmt.sql
blob: d6d805a82631fd07359d1c0bd33fbda472ec7d92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* postgres can not */
select cast("2000-01-01,GMT" as tzdate) == cast("2000-01-01" as date);
select cast("2000-01-01,GMT" as tzdate) < cast("2000-01-01" as date);
select cast("2000-01-01,GMT" as tzdate) <= cast("2000-01-01" as date);
select cast("2000-01-01,GMT" as tzdate) > cast("2000-01-01" as date);
select cast("2000-01-01,GMT" as tzdate) >= cast("2000-01-01" as date);
select cast("2000-01-01,GMT" as tzdate) != cast("2000-01-01" as date);

select cast("2000-01-01" as date) == cast("2000-01-01,GMT" as tzdate);
select cast("2000-01-01" as date) < cast("2000-01-01,GMT" as tzdate);
select cast("2000-01-01" as date) <= cast("2000-01-01,GMT" as tzdate);
select cast("2000-01-01" as date) > cast("2000-01-01,GMT" as tzdate);
select cast("2000-01-01" as date) >= cast("2000-01-01,GMT" as tzdate);
select cast("2000-01-01" as date) != cast("2000-01-01,GMT" as tzdate);

select cast("2000-01-01T12:00:00,GMT" as tzdatetime) == cast("2000-01-01T12:00:00Z" as datetime);
select cast("2000-01-01T12:00:00,GMT" as tzdatetime) < cast("2000-01-01T12:00:00Z" as datetime);
select cast("2000-01-01T12:00:00,GMT" as tzdatetime) <= cast("2000-01-01T12:00:00Z" as datetime);
select cast("2000-01-01T12:00:00,GMT" as tzdatetime) > cast("2000-01-01T12:00:00Z" as datetime);
select cast("2000-01-01T12:00:00,GMT" as tzdatetime) >= cast("2000-01-01T12:00:00Z" as datetime);
select cast("2000-01-01T12:00:00,GMT" as tzdatetime) != cast("2000-01-01T12:00:00Z" as datetime);

select cast("2000-01-01T12:00:00Z" as datetime) == cast("2000-01-01T12:00:00,GMT" as tzdatetime);
select cast("2000-01-01T12:00:00Z" as datetime) < cast("2000-01-01T12:00:00,GMT" as tzdatetime);
select cast("2000-01-01T12:00:00Z" as datetime) <= cast("2000-01-01T12:00:00,GMT" as tzdatetime);
select cast("2000-01-01T12:00:00Z" as datetime) > cast("2000-01-01T12:00:00,GMT" as tzdatetime);
select cast("2000-01-01T12:00:00Z" as datetime) >= cast("2000-01-01T12:00:00,GMT" as tzdatetime);
select cast("2000-01-01T12:00:00Z" as datetime) != cast("2000-01-01T12:00:00,GMT" as tzdatetime);

select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) == cast("2000-01-01T12:00:00.123456Z" as timestamp);
select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) < cast("2000-01-01T12:00:00.123456Z" as timestamp);
select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) <= cast("2000-01-01T12:00:00.123456Z" as timestamp);
select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) > cast("2000-01-01T12:00:00.123456Z" as timestamp);
select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) >= cast("2000-01-01T12:00:00.123456Z" as timestamp);
select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) != cast("2000-01-01T12:00:00.123456Z" as timestamp);

select cast("2000-01-01T12:00:00.123456Z" as timestamp) == cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
select cast("2000-01-01T12:00:00.123456Z" as timestamp) < cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
select cast("2000-01-01T12:00:00.123456Z" as timestamp) <= cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
select cast("2000-01-01T12:00:00.123456Z" as timestamp) > cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
select cast("2000-01-01T12:00:00.123456Z" as timestamp) >= cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
select cast("2000-01-01T12:00:00.123456Z" as timestamp) != cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);