回答編集履歴

1

改良

2017/05/26 07:51

投稿

yambejp
yambejp

スコア114883

test CHANGED
@@ -37,3 +37,33 @@
37
37
 
38
38
 
39
39
  ```
40
+
41
+
42
+
43
+ # 改良版
44
+
45
+
46
+
47
+ ```SQL
48
+
49
+ select * from ic
50
+
51
+ where id in (
52
+
53
+ select min(id) from ic
54
+
55
+ where (use_date,in_station,out_station,is_request) in (
56
+
57
+ select use_date,in_station,out_station,max(is_request) as is_request from ic
58
+
59
+ where is_request in (0,1)
60
+
61
+ group by use_date,in_station,out_station
62
+
63
+ )
64
+
65
+ group by use_date,in_station,out_station
66
+
67
+ );
68
+
69
+ ```