回答編集履歴

1

更新

2016/12/06 05:13

投稿

A.Ichi
A.Ichi

スコア4070

test CHANGED
@@ -12,9 +12,11 @@
12
12
 
13
13
 
14
14
 
15
- select t7.adate as date, t7.ahour as hour, t7.category, t8.name, t7.comment from
15
+ select t9.adate as date, t9.ahour as hour, t9.category, t8.name, t7.comment from a_tbl t9
16
16
 
17
+ join
18
+
17
- (select t5.adate, t5.ahour, t5.member_id, t6.comment, t5.category from a_tbl t5
19
+ (select t5.adate, min(t5.ahour) as ahour, t5.member_id, t6.comment, t5.category from a_tbl t5
18
20
 
19
21
  join ( select * from c_tbl t3 join (select t1.member_id, max(id) as id from c_tbl t1
20
22
 
@@ -24,8 +26,8 @@
24
26
 
25
27
  using(member_id,id)) t6 using (member_id) group by t5.member_id) t7
26
28
 
29
+ using(adate,ahour,member_id)
30
+
27
31
  join b_tbl t8 on t8.id=t7.member_id;
28
32
 
29
-
30
-
31
33
  ```