質問編集履歴
4
クエリ編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -172,13 +172,13 @@
|
|
172
172
|
|
173
173
|
|
174
174
|
|
175
|
-
insert into tbl_
|
175
|
+
insert into tbl_c (d, val, dt) values ("2019-05-23", 30, "2019-05-22 03:00:00");
|
176
176
|
|
177
|
-
insert into tbl_
|
177
|
+
insert into tbl_c (d, val, dt) values ("2019-05-23", 31, "2019-05-22 04:00:00");
|
178
178
|
|
179
|
-
insert into tbl_
|
179
|
+
insert into tbl_c (d, val, dt) values ("2019-05-23", 32, "2019-05-22 05:00:00");
|
180
180
|
|
181
|
-
insert into tbl_
|
181
|
+
insert into tbl_c (d, val, dt) values ("2019-05-23", 33, "2019-05-22 06:00:00");
|
182
182
|
|
183
183
|
```
|
184
184
|
|
3
クエリ編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -124,61 +124,61 @@
|
|
124
124
|
|
125
125
|
```
|
126
126
|
|
127
|
-
create table t
|
127
|
+
create table tbl_a (d date, val int, dt datetime);
|
128
128
|
|
129
|
-
create table t
|
129
|
+
create table tbl_b (d date, val int, dt datetime);
|
130
130
|
|
131
|
-
create table t
|
131
|
+
create table tbl_c (d date, val int, dt datetime);
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
-
insert into t
|
135
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 10, "2019-05-22 00:00:00");
|
136
136
|
|
137
|
-
insert into t
|
137
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 11, "2019-05-22 01:00:00");
|
138
138
|
|
139
|
-
insert into t
|
139
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 12, "2019-05-22 02:00:00");
|
140
140
|
|
141
|
-
insert into t
|
141
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 13, "2019-05-22 03:00:00");
|
142
142
|
|
143
|
-
insert into t
|
143
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 14, "2019-05-22 04:00:00");
|
144
144
|
|
145
|
-
insert into t
|
145
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 15, "2019-05-22 05:00:00");
|
146
146
|
|
147
|
-
insert into t
|
147
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 16, "2019-05-22 06:00:00");
|
148
148
|
|
149
|
-
insert into t
|
149
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 17, "2019-05-22 07:00:00");
|
150
150
|
|
151
151
|
|
152
152
|
|
153
|
-
insert into t
|
153
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 20, "2019-05-22 02:00:00");
|
154
154
|
|
155
|
-
insert into t
|
155
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 21, "2019-05-22 03:00:00");
|
156
156
|
|
157
|
-
insert into t
|
157
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 22, "2019-05-22 04:00:00");
|
158
158
|
|
159
|
-
insert into t
|
159
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 23, "2019-05-22 05:00:00");
|
160
160
|
|
161
|
-
insert into t
|
161
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 24, "2019-05-22 06:00:00");
|
162
162
|
|
163
|
-
insert into t
|
163
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 25, "2019-05-22 07:00:00");
|
164
164
|
|
165
|
-
insert into t
|
165
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 26, "2019-05-22 08:00:00");
|
166
166
|
|
167
|
-
insert into t
|
167
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 27, "2019-05-22 09:00:00");
|
168
168
|
|
169
|
-
insert into t
|
169
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 28, "2019-05-22 10:00:00");
|
170
170
|
|
171
|
-
insert into t
|
171
|
+
insert into tbl_b (d, val, dt) values ("2019-05-23", 29, "2019-05-22 11:00:00");
|
172
172
|
|
173
173
|
|
174
174
|
|
175
|
-
insert into t
|
175
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 30, "2019-05-22 03:00:00");
|
176
176
|
|
177
|
-
insert into t
|
177
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 31, "2019-05-22 04:00:00");
|
178
178
|
|
179
|
-
insert into t
|
179
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 32, "2019-05-22 05:00:00");
|
180
180
|
|
181
|
-
insert into t
|
181
|
+
insert into tbl_a (d, val, dt) values ("2019-05-23", 33, "2019-05-22 06:00:00");
|
182
182
|
|
183
183
|
```
|
184
184
|
|
2
試せるようにクエリを貼った
test
CHANGED
File without changes
|
test
CHANGED
@@ -113,3 +113,75 @@
|
|
113
113
|
|
114
114
|
|
115
115
|
よろしくお願いします.
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
### 補足
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
以下に上記のデータを作成できるクエリを貼っておきます.
|
124
|
+
|
125
|
+
```
|
126
|
+
|
127
|
+
create table table_a (d date, val int, dt datetime);
|
128
|
+
|
129
|
+
create table table_b (d date, val int, dt datetime);
|
130
|
+
|
131
|
+
create table table_c (d date, val int, dt datetime);
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 10, "2019-05-22 00:00:00");
|
136
|
+
|
137
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 11, "2019-05-22 01:00:00");
|
138
|
+
|
139
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 12, "2019-05-22 02:00:00");
|
140
|
+
|
141
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 13, "2019-05-22 03:00:00");
|
142
|
+
|
143
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 14, "2019-05-22 04:00:00");
|
144
|
+
|
145
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 15, "2019-05-22 05:00:00");
|
146
|
+
|
147
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 16, "2019-05-22 06:00:00");
|
148
|
+
|
149
|
+
insert into table_a (d, val, dt) values ("2019-05-23", 17, "2019-05-22 07:00:00");
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 20, "2019-05-22 02:00:00");
|
154
|
+
|
155
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 21, "2019-05-22 03:00:00");
|
156
|
+
|
157
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 22, "2019-05-22 04:00:00");
|
158
|
+
|
159
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 23, "2019-05-22 05:00:00");
|
160
|
+
|
161
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 24, "2019-05-22 06:00:00");
|
162
|
+
|
163
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 25, "2019-05-22 07:00:00");
|
164
|
+
|
165
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 26, "2019-05-22 08:00:00");
|
166
|
+
|
167
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 27, "2019-05-22 09:00:00");
|
168
|
+
|
169
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 28, "2019-05-22 10:00:00");
|
170
|
+
|
171
|
+
insert into table_b (d, val, dt) values ("2019-05-23", 29, "2019-05-22 11:00:00");
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
insert into table_c (d, val, dt) values ("2019-05-23", 30, "2019-05-22 03:00:00");
|
176
|
+
|
177
|
+
insert into table_c (d, val, dt) values ("2019-05-23", 31, "2019-05-22 04:00:00");
|
178
|
+
|
179
|
+
insert into table_c (d, val, dt) values ("2019-05-23", 32, "2019-05-22 05:00:00");
|
180
|
+
|
181
|
+
insert into table_c (d, val, dt) values ("2019-05-23", 33, "2019-05-22 06:00:00");
|
182
|
+
|
183
|
+
```
|
184
|
+
|
185
|
+
paiza.io等でお試しください.
|
186
|
+
|
187
|
+
よろしくお願いします.
|
1
複雑な質問ではないにもかかわらず、あまりにも回答が来ないため、タイトルを変更してタグも追加しました
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
MySQL 複数のデータ
|
1
|
+
MySQL 複数のデータを、時刻を基準として漏れなく結合したい
|
test
CHANGED
File without changes
|