質問編集履歴

2

サンプルデータ追加しました

2020/11/19 09:46

投稿

sou10
sou10

スコア4

test CHANGED
File without changes
test CHANGED
@@ -47,6 +47,22 @@
47
47
  device_type:デバイスの種類(今回はタイプ2で限定したいです)
48
48
 
49
49
 
50
+
51
+
52
+
53
+ サンプルデータ
54
+
55
+ id started_at ended_at device_type
56
+
57
+ 679000 2020-10-15 12:13 2
58
+
59
+ 342000 2020-10-15 21:35 2
60
+
61
+ 275000 2020-10-19 10:10 2
62
+
63
+ 689000 2020-10-30 22:50 2
64
+
65
+ 990000 2020-11-01 08:50 2
50
66
 
51
67
 
52
68
 

1

クエリ中身の自体が間違えていたので修正しました

2020/11/19 09:46

投稿

sou10
sou10

スコア4

test CHANGED
File without changes
test CHANGED
@@ -90,9 +90,9 @@
90
90
 
91
91
  ( SELECT GENERATE_SERIES(
92
92
 
93
- (select cast(min(started_at+ interval '9 hour') as date) from cows_sensor_device_histories as X)
93
+ (select cast(min(started_at+ interval '9 hour') as date) from device_histories as X)
94
94
 
95
- , (select cast(max(now()) as date) from cows_sensor_device_histories as Y)
95
+ , (select cast(max(now()) as date) from device_histories as Y)
96
96
 
97
97
  ,'1 day'
98
98