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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
create table t (
a int,
b int without system versioning
) with system versioning;
insert into t values(1, 2);
insert into t values(3, 4);
select * from t;
a b
1 2
3 4
select a from t for system_time as of timestamp now(6);
a
1
3
select a, b, b+0 from t for system_time as of timestamp now(6);
a b b+0
1 NULL NULL
3 NULL NULL
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t for system_time as of timestamp now(6);
a b
1 NULL
3 NULL
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select count(*) from t group by b system_time as of timestamp now(6);
count(*)
2
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t for system_time as of timestamp now(6) order by b asc;
a b
1 NULL
3 NULL
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t for system_time as of timestamp now(6) order by b desc;
a b
1 NULL
3 NULL
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t group by a having a=2 system_time as of timestamp now(6);
a b
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t group by b having b=2 system_time as of timestamp now(6);
a b
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
select a from t where b=2 system_time as of timestamp now(6);
a
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select a from t where b=NULL system_time as of timestamp now(6);
a
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select a from t where b is NULL system_time as of timestamp now(6);
a
1
3
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select count(*), b from t group by b having b=NULL system_time as of timestamp now(6);
count(*) b
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
select a, b from t;
a b
1 2
3 4
select count(*) from t for system_time as of timestamp now(6) group by b;
count(*)
2
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t for system_time as of timestamp now(6) group by b having b=2;
a b
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
select a from t for system_time as of timestamp now(6) where b=2;
a
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select a from t for system_time as of timestamp now(6) where b=NULL;
a
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select a from t for system_time as of timestamp now(6) where b is NULL;
a
1
3
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select count(*), b from t for system_time as of timestamp now(6) group by b having b=NULL;
count(*) b
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
create or replace table t (
a int,
b int not null without system versioning
) with system versioning;
insert into t values (1, 2), (3, 4);
select * from t for system_time as of timestamp now(6);
a b
1 NULL
3 NULL
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
select * from t for system_time as of timestamp now(6) where b is NULL;
a b
1 NULL
3 NULL
Warnings:
Warning 4109 Attempt to read unversioned field `b` in historical query
Warning 4109 Attempt to read unversioned field `b` in historical query
drop table t;
|