回答編集履歴
2
訂正
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
from tbl
|
12
12
|
|
13
|
-
group by trunc(time,'MI')
|
13
|
+
group by trunc(time,'MI')
|
14
14
|
|
15
15
|
) t
|
16
16
|
|
1
訂正
test
CHANGED
@@ -1 +1,17 @@
|
|
1
|
-
time から正時を求めて
|
1
|
+
time から正時を求めてWindow関数で累計を取って下さい。
|
2
|
+
|
3
|
+
```
|
4
|
+
|
5
|
+
select just_hour, sum(cnt) over(order by just_hour)
|
6
|
+
|
7
|
+
from (
|
8
|
+
|
9
|
+
select trunc(time,'MI') just_hour, count(*) cnt
|
10
|
+
|
11
|
+
from tbl
|
12
|
+
|
13
|
+
group by trunc(time,'MI') just_hour
|
14
|
+
|
15
|
+
) t
|
16
|
+
|
17
|
+
```
|