aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/datetime/date_diff_compare.sql
blob: 862ecde03e4560b8aed9d86e0075f095b80d5576 (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
/* postgres can not */
select Date("2001-01-01") == Datetime("2001-01-01T00:00:00Z");
select Date("2001-01-01") == Timestamp("2001-01-01T00:00:00Z");
select Datetime("2001-01-01T00:00:00Z") == Timestamp("2001-01-01T00:00:00Z");

select Date("2001-01-01") != Datetime("2001-01-01T00:00:00Z");
select Date("2001-01-01") != Timestamp("2001-01-01T00:00:00Z");
select Datetime("2001-01-01T00:00:00Z") != Timestamp("2001-01-01T00:00:00Z");

select Date("2001-01-01") < Datetime("2001-01-01T00:00:00Z");
select Date("2001-01-01") < Timestamp("2001-01-01T00:00:00Z");
select Datetime("2001-01-01T00:00:00Z") < Timestamp("2001-01-01T00:00:00Z");

select Date("2001-01-01") <= Datetime("2001-01-01T00:00:00Z");
select Date("2001-01-01") <= Timestamp("2001-01-01T00:00:00Z");
select Datetime("2001-01-01T00:00:00Z") <= Timestamp("2001-01-01T00:00:00Z");

select Date("2001-01-01") > Datetime("2001-01-01T00:00:00Z");
select Date("2001-01-01") > Timestamp("2001-01-01T00:00:00Z");
select Datetime("2001-01-01T00:00:00Z") > Timestamp("2001-01-01T00:00:00Z");

select Date("2001-01-01") >= Datetime("2001-01-01T00:00:00Z");
select Date("2001-01-01") >= Timestamp("2001-01-01T00:00:00Z");
select Datetime("2001-01-01T00:00:00Z") >= Timestamp("2001-01-01T00:00:00Z");