質問編集履歴
18
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,51 +13,3 @@
|
|
13
13
|
insertを96回せずに1回で終わる方法はないでしょうか?
|
14
14
|
|
15
15
|
CASE文とか使えば上手くいきそうな気がしますが、良い案が思いつきません。
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
(1)が1日分で15分毎に増えていき0000,0015,0030,...1145まです。
|
20
|
-
|
21
|
-
(2)と(4)は全て同じ日付です。
|
22
|
-
|
23
|
-
(3)と(5)は1日分で同じ時間帯で15分ずつ増えて行き1145 and 1159まです。
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
コード
|
28
|
-
|
29
|
-
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
30
|
-
|
31
|
-
Select
|
32
|
-
|
33
|
-
am01.test1, am02.test2, am02.test3, am02.test4,
|
34
|
-
|
35
|
-
am02.test5, am02.test6, am02.test7, am01.test8,
|
36
|
-
|
37
|
-
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
38
|
-
|
39
|
-
am01.test13,am02.test14, '0000' -- (1)
|
40
|
-
|
41
|
-
From
|
42
|
-
|
43
|
-
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
44
|
-
|
45
|
-
min(test_time) as test_time_min
|
46
|
-
|
47
|
-
From tmp.test77_tbl
|
48
|
-
|
49
|
-
Where sp_date='20160801' -- (2)
|
50
|
-
|
51
|
-
and Substr(test_time,1,4) between 0000 and 0014 Group by test1, test8) am01 --(3)
|
52
|
-
|
53
|
-
Left outer Join
|
54
|
-
|
55
|
-
(Select * from tmp.test77_tbl
|
56
|
-
|
57
|
-
where sp_date='20160801' -- (4)
|
58
|
-
|
59
|
-
and Substr(test_time,1,4) between 0000 and 0014) am02 --(5)
|
60
|
-
|
61
|
-
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
62
|
-
|
63
|
-
And am01.test_time_min = am02.test_time);
|
17
見づらいため
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,8 +23,6 @@
|
|
23
23
|
(3)と(5)は1日分で同じ時間帯で15分ずつ増えて行き1145 and 1159まです。
|
24
24
|
|
25
25
|
|
26
|
-
|
27
|
-
sql_1
|
28
26
|
|
29
27
|
コード
|
30
28
|
|
16
誤字脱字
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
sqlはdmlができるくらいのレベル
|
1
|
+
sqlはdmlができるくらいのレベルです。ほぼ初心者レベルです。
|
2
2
|
|
3
3
|
Hive,バージョン1.0.0
|
4
4
|
|
15
見づらいため
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
sqlはdmlができるくらいのレベルなのにhiveをやる事になりました。
|
2
|
+
|
1
3
|
Hive,バージョン1.0.0
|
2
4
|
|
3
5
|
すべてを記載すると長くて読みづらいので割愛しています。
|
14
見づらいため
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
Hive
|
1
|
+
Hive,バージョン1.0.0
|
2
|
-
|
3
|
-
もしくはHiveに近いとされるMysqlの方法でもかまいません。
|
4
2
|
|
5
3
|
すべてを記載すると長くて読みづらいので割愛しています。
|
6
4
|
|
@@ -63,129 +61,3 @@
|
|
63
61
|
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
64
62
|
|
65
63
|
And am01.test_time_min = am02.test_time);
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
sql_2
|
70
|
-
|
71
|
-
コード
|
72
|
-
|
73
|
-
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
74
|
-
|
75
|
-
Select
|
76
|
-
|
77
|
-
am01.test1, am02.test2, am02.test3, am02.test4,
|
78
|
-
|
79
|
-
am02.test5, am02.test6, am02.test7, am01.test8,
|
80
|
-
|
81
|
-
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
82
|
-
|
83
|
-
am01.test13,am02.test14, '0015' -- (1)
|
84
|
-
|
85
|
-
From
|
86
|
-
|
87
|
-
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
88
|
-
|
89
|
-
min(test_time) as test_time_min
|
90
|
-
|
91
|
-
From tmp.test77_tbl
|
92
|
-
|
93
|
-
Where sp_date='20160801' -- (2)
|
94
|
-
|
95
|
-
and Substr(test_time,1,4) between 0015 and 0029 Group by test1, test8) am01 --(3)
|
96
|
-
|
97
|
-
Left outer Join
|
98
|
-
|
99
|
-
(Select * from tmp.test77_tbl
|
100
|
-
|
101
|
-
where sp_date='20160801' -- (4)
|
102
|
-
|
103
|
-
and Substr(test_time,1,4) between 0015 and 0029) am02 --(5)
|
104
|
-
|
105
|
-
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
106
|
-
|
107
|
-
And am01.test_time_min = am02.test_time);
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
sql_3
|
112
|
-
|
113
|
-
コード
|
114
|
-
|
115
|
-
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
116
|
-
|
117
|
-
Select
|
118
|
-
|
119
|
-
am01.test1, am02.test2, am02.test3, am02.test4,
|
120
|
-
|
121
|
-
am02.test5, am02.test6, am02.test7, am01.test8,
|
122
|
-
|
123
|
-
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
124
|
-
|
125
|
-
am01.test13,am02.test14, '0030' -- (1)
|
126
|
-
|
127
|
-
From
|
128
|
-
|
129
|
-
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
130
|
-
|
131
|
-
min(test_time) as test_time_min
|
132
|
-
|
133
|
-
From tmp.test77_tbl
|
134
|
-
|
135
|
-
Where sp_date='20160801' -- (2)
|
136
|
-
|
137
|
-
and Substr(test_time,1,4) between 0030 and 0044 Group by test1, test8) am01 --(3)
|
138
|
-
|
139
|
-
Left outer Join
|
140
|
-
|
141
|
-
(Select * from tmp.test77_tbl
|
142
|
-
|
143
|
-
where sp_date='20160801' -- (4)
|
144
|
-
|
145
|
-
and Substr(test_time,1,4) between 0030 and 0044) am02 --(5)
|
146
|
-
|
147
|
-
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
148
|
-
|
149
|
-
And am01.test_time_min = am02.test_time);
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
sql_4
|
154
|
-
|
155
|
-
コード
|
156
|
-
|
157
|
-
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
158
|
-
|
159
|
-
Select
|
160
|
-
|
161
|
-
am01.test1, am02.test2, am02.test3, am02.test4,
|
162
|
-
|
163
|
-
am02.test5, am02.test6, am02.test7, am01.test8,
|
164
|
-
|
165
|
-
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
166
|
-
|
167
|
-
am01.test13,am02.test14, '0045' -- (1)
|
168
|
-
|
169
|
-
From
|
170
|
-
|
171
|
-
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
172
|
-
|
173
|
-
min(test_time) as test_time_min
|
174
|
-
|
175
|
-
From tmp.test77_tbl
|
176
|
-
|
177
|
-
Where sp_date='20160801' -- (2)
|
178
|
-
|
179
|
-
and Substr(test_time,1,4) between 0045 and 0059 Group by test1, test8) am01 --(3)
|
180
|
-
|
181
|
-
Left outer Join
|
182
|
-
|
183
|
-
(Select * from tmp.test77_tbl
|
184
|
-
|
185
|
-
where sp_date='20160801' -- (4)
|
186
|
-
|
187
|
-
and Substr(test_time,1,4) between 0045 and 0059) am02 --(5)
|
188
|
-
|
189
|
-
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
190
|
-
|
191
|
-
And am01.test_time_min = am02.test_time);
|
13
補足
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
テーブル自体を簡略化したいです。
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Hiveでの
|
1
|
+
Hiveでのクエリについて聞きたいです。
|
2
2
|
|
3
3
|
もしくはHiveに近いとされるMysqlの方法でもかまいません。
|
4
4
|
|
@@ -8,13 +8,11 @@
|
|
8
8
|
|
9
9
|
以下のようなinsert文が96あります。
|
10
10
|
|
11
|
-
15分おきのデータで1日分ありテーブルにinsertを96回行わないといかず時間がかか
|
11
|
+
15分おきのデータで1日分ありテーブルにinsertを96回行わないといかず日付データを入れ替えるだけで面倒だしミスもしやすいし時間がかかります。
|
12
12
|
|
13
|
-
|
13
|
+
insertを96回せずに1回で終わる方法はないでしょうか?
|
14
14
|
|
15
|
-
とりあえず、**union all**でクエリを作ってみたのですが流し終わるのに6時間くらいかかりました。
|
16
|
-
|
17
|
-
|
15
|
+
CASE文とか使えば上手くいきそうな気がしますが、良い案が思いつきません。
|
18
16
|
|
19
17
|
|
20
18
|
|
12
編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
一回で処理を終わらせて時間を短縮したいと思ってます。
|
14
14
|
|
15
|
-
|
15
|
+
とりあえず、**union all**でクエリを作ってみたのですが流し終わるのに6時間くらいかかりました。
|
16
16
|
|
17
17
|
他に何か方法ないでしょうか?時間を短縮したいです。
|
18
18
|
|
11
goji
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,11 +12,9 @@
|
|
12
12
|
|
13
13
|
一回で処理を終わらせて時間を短縮したいと思ってます。
|
14
14
|
|
15
|
-
全部繋げる、**union all**は思いついたのですが
|
15
|
+
全部繋げる、**union all**は思いついたのですが時間がかかってしまいました。
|
16
16
|
|
17
|
-
他に何か方法ないでしょうか?
|
17
|
+
他に何か方法ないでしょうか?時間を短縮したいです。
|
18
|
-
|
19
|
-
テーブル自体を簡略化して時間を短縮したいです。
|
20
18
|
|
21
19
|
|
22
20
|
|
10
test
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
9
ついか
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Hiveでのinsertについてお聞きしたいです。
|
2
2
|
|
3
3
|
もしくはHiveに近いとされるMysqlの方法でもかまいません。
|
4
|
+
|
5
|
+
すべてを記載すると長くて読みづらいので割愛しています。
|
4
6
|
|
5
7
|
|
6
8
|
|
8
てst
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
Hiveでのinsertについてです。
|
1
|
+
Hiveでのinsertについてお聞きしたいです。
|
2
|
+
|
3
|
+
もしくはHiveに近いとされるMysqlの方法でもかまいません。
|
2
4
|
|
3
5
|
|
4
6
|
|
7
test
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
6
変更
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
5
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
Hiveでのinsertについてです。
|
2
|
+
|
3
|
+
|
4
|
+
|
1
5
|
以下のようなinsert文が96あります。
|
2
6
|
|
3
7
|
15分おきのデータで1日分ありテーブルにinsertを96回行わないといかず時間がかかってしまいます。
|
4
誤字脱字
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
以下のようなinsert文があります。
|
1
|
+
以下のようなinsert文が96あります。
|
2
2
|
|
3
3
|
15分おきのデータで1日分ありテーブルにinsertを96回行わないといかず時間がかかってしまいます。
|
4
4
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
(1)が1日分で15分毎に増えていき0000,0015,0030,...1145まです。
|
16
16
|
|
17
|
-
|
17
|
+
(2)と(4)は全て同じ日付です。
|
18
18
|
|
19
19
|
(3)と(5)は1日分で同じ時間帯で15分ずつ増えて行き1145 and 1159まです。
|
20
20
|
|
@@ -104,7 +104,7 @@
|
|
104
104
|
|
105
105
|
|
106
106
|
|
107
|
-
sql3
|
107
|
+
sql_3
|
108
108
|
|
109
109
|
コード
|
110
110
|
|
@@ -146,7 +146,7 @@
|
|
146
146
|
|
147
147
|
|
148
148
|
|
149
|
-
sql4
|
149
|
+
sql_4
|
150
150
|
|
151
151
|
コード
|
152
152
|
|
3
誤字脱字
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
insert文
|
1
|
+
追加するinsert文が大量にあるのでunion all 以外で繋げてテーブル自体を簡略化して時間を短縮したいです。
|
test
CHANGED
@@ -1,16 +1,26 @@
|
|
1
|
-
以下のようなinsert文が
|
1
|
+
以下のようなinsert文があります。
|
2
2
|
|
3
|
+
15分おきのデータで1日分ありテーブルにinsertを96回行わないといかず時間がかかってしまいます。
|
4
|
+
|
5
|
+
一回で処理を終わらせて時間を短縮したいと思ってます。
|
6
|
+
|
3
|
-
全部繋げる、union allは思いついたのですがとても長いテーブルになってしまって時間がかか
|
7
|
+
全部繋げる、**union all**は思いついたのですがとても長いテーブルになってしまって時間がかかってしまいました。
|
8
|
+
|
9
|
+
他に何か方法ないでしょうか?
|
10
|
+
|
11
|
+
テーブル自体を簡略化して時間を短縮したいです。
|
4
12
|
|
5
13
|
|
6
14
|
|
7
|
-
(1)が1日分で15分毎に増えていき1145まです。
|
15
|
+
(1)が1日分で15分毎に増えていき0000,0015,0030,...1145まです。
|
8
16
|
|
9
|
-
(2)と(4)は同じ日付です。
|
17
|
+
(2)と(4)は全て同じ日付です。
|
10
18
|
|
11
|
-
(3)と(5)は1日分で15分ずつ増えて1159まです。
|
19
|
+
(3)と(5)は1日分で同じ時間帯で15分ずつ増えて行き1145 and 1159まです。
|
12
20
|
|
21
|
+
|
22
|
+
|
13
|
-
sql
|
23
|
+
sql_1
|
14
24
|
|
15
25
|
コード
|
16
26
|
|
@@ -52,7 +62,7 @@
|
|
52
62
|
|
53
63
|
|
54
64
|
|
55
|
-
sql2
|
65
|
+
sql_2
|
56
66
|
|
57
67
|
コード
|
58
68
|
|
2
誤字脱字
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,11 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
+
(1)が1日分で15分毎に増えていき1145まです。
|
8
|
+
|
9
|
+
(2)と(4)は同じ日付です。
|
10
|
+
|
7
|
-
(
|
11
|
+
(3)と(5)は1日分で15分ずつ増えて1159まです。
|
8
12
|
|
9
13
|
sql
|
10
14
|
|
@@ -96,7 +100,9 @@
|
|
96
100
|
|
97
101
|
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
98
102
|
|
103
|
+
Select
|
104
|
+
|
99
|
-
|
105
|
+
am01.test1, am02.test2, am02.test3, am02.test4,
|
100
106
|
|
101
107
|
am02.test5, am02.test6, am02.test7, am01.test8,
|
102
108
|
|
@@ -136,7 +142,9 @@
|
|
136
142
|
|
137
143
|
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
138
144
|
|
145
|
+
Select
|
146
|
+
|
139
|
-
|
147
|
+
am01.test1, am02.test2, am02.test3, am02.test4,
|
140
148
|
|
141
149
|
am02.test5, am02.test6, am02.test7, am01.test8,
|
142
150
|
|
1
見づらいため
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,10 +4,166 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
|
7
|
+
(1)が15分毎に増えていき1145まで(2)と(4)は同じ日付(3)と(5)は15分ずつ増えて1159まです。
|
8
8
|
|
9
|
-
|
9
|
+
sql
|
10
10
|
|
11
|
-
|
11
|
+
コード
|
12
12
|
|
13
|
-
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
13
|
+
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
14
|
+
|
15
|
+
Select
|
16
|
+
|
17
|
+
am01.test1, am02.test2, am02.test3, am02.test4,
|
18
|
+
|
19
|
+
am02.test5, am02.test6, am02.test7, am01.test8,
|
20
|
+
|
21
|
+
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
22
|
+
|
23
|
+
am01.test13,am02.test14, '0000' -- (1)
|
24
|
+
|
25
|
+
From
|
26
|
+
|
27
|
+
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
28
|
+
|
29
|
+
min(test_time) as test_time_min
|
30
|
+
|
31
|
+
From tmp.test77_tbl
|
32
|
+
|
33
|
+
Where sp_date='20160801' -- (2)
|
34
|
+
|
35
|
+
and Substr(test_time,1,4) between 0000 and 0014 Group by test1, test8) am01 --(3)
|
36
|
+
|
37
|
+
Left outer Join
|
38
|
+
|
39
|
+
(Select * from tmp.test77_tbl
|
40
|
+
|
41
|
+
where sp_date='20160801' -- (4)
|
42
|
+
|
43
|
+
and Substr(test_time,1,4) between 0000 and 0014) am02 --(5)
|
44
|
+
|
45
|
+
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
46
|
+
|
47
|
+
And am01.test_time_min = am02.test_time);
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
sql2
|
52
|
+
|
53
|
+
コード
|
54
|
+
|
55
|
+
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
56
|
+
|
57
|
+
Select
|
58
|
+
|
59
|
+
am01.test1, am02.test2, am02.test3, am02.test4,
|
60
|
+
|
61
|
+
am02.test5, am02.test6, am02.test7, am01.test8,
|
62
|
+
|
63
|
+
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
64
|
+
|
65
|
+
am01.test13,am02.test14, '0015' -- (1)
|
66
|
+
|
67
|
+
From
|
68
|
+
|
69
|
+
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
70
|
+
|
71
|
+
min(test_time) as test_time_min
|
72
|
+
|
73
|
+
From tmp.test77_tbl
|
74
|
+
|
75
|
+
Where sp_date='20160801' -- (2)
|
76
|
+
|
77
|
+
and Substr(test_time,1,4) between 0015 and 0029 Group by test1, test8) am01 --(3)
|
78
|
+
|
79
|
+
Left outer Join
|
80
|
+
|
81
|
+
(Select * from tmp.test77_tbl
|
82
|
+
|
83
|
+
where sp_date='20160801' -- (4)
|
84
|
+
|
85
|
+
and Substr(test_time,1,4) between 0015 and 0029) am02 --(5)
|
86
|
+
|
87
|
+
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
88
|
+
|
89
|
+
And am01.test_time_min = am02.test_time);
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
sql3
|
94
|
+
|
95
|
+
コード
|
96
|
+
|
97
|
+
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
98
|
+
|
99
|
+
Select am01.test1, am02.test2, am02.test3, am02.test4,
|
100
|
+
|
101
|
+
am02.test5, am02.test6, am02.test7, am01.test8,
|
102
|
+
|
103
|
+
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
104
|
+
|
105
|
+
am01.test13,am02.test14, '0030' -- (1)
|
106
|
+
|
107
|
+
From
|
108
|
+
|
109
|
+
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
110
|
+
|
111
|
+
min(test_time) as test_time_min
|
112
|
+
|
113
|
+
From tmp.test77_tbl
|
114
|
+
|
115
|
+
Where sp_date='20160801' -- (2)
|
116
|
+
|
117
|
+
and Substr(test_time,1,4) between 0030 and 0044 Group by test1, test8) am01 --(3)
|
118
|
+
|
119
|
+
Left outer Join
|
120
|
+
|
121
|
+
(Select * from tmp.test77_tbl
|
122
|
+
|
123
|
+
where sp_date='20160801' -- (4)
|
124
|
+
|
125
|
+
and Substr(test_time,1,4) between 0030 and 0044) am02 --(5)
|
126
|
+
|
127
|
+
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
128
|
+
|
129
|
+
And am01.test_time_min = am02.test_time);
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
sql4
|
134
|
+
|
135
|
+
コード
|
136
|
+
|
137
|
+
Insert Into Table test_tmp.Am_15min Partition (sp_yyyymmdd,sp_hhmm)
|
138
|
+
|
139
|
+
Select am01.test1, am02.test2, am02.test3, am02.test4,
|
140
|
+
|
141
|
+
am02.test5, am02.test6, am02.test7, am01.test8,
|
142
|
+
|
143
|
+
am02.test9, am02.test10,am02.test_time, am01.run_time,
|
144
|
+
|
145
|
+
am01.test13,am02.test14, '0045' -- (1)
|
146
|
+
|
147
|
+
From
|
148
|
+
|
149
|
+
(Select test1,test8,avg(run_time) as run_time_avg,count(test8) as test13,
|
150
|
+
|
151
|
+
min(test_time) as test_time_min
|
152
|
+
|
153
|
+
From tmp.test77_tbl
|
154
|
+
|
155
|
+
Where sp_date='20160801' -- (2)
|
156
|
+
|
157
|
+
and Substr(test_time,1,4) between 0045 and 0059 Group by test1, test8) am01 --(3)
|
158
|
+
|
159
|
+
Left outer Join
|
160
|
+
|
161
|
+
(Select * from tmp.test77_tbl
|
162
|
+
|
163
|
+
where sp_date='20160801' -- (4)
|
164
|
+
|
165
|
+
and Substr(test_time,1,4) between 0045 and 0059) am02 --(5)
|
166
|
+
|
167
|
+
On (am01.test1 = am02.test1 And am01.test8 = am02.test8
|
168
|
+
|
169
|
+
And am01.test_time_min = am02.test_time);
|