回答編集履歴
2
コード追記
test
CHANGED
@@ -25,3 +25,41 @@
|
|
25
25
|
AND t1.id = t2.id;
|
26
26
|
|
27
27
|
```
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
追記
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
質問内容が変更されたので、変更後の仕様だと、下記でしょうか。
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
```sql
|
40
|
+
|
41
|
+
SELECT t1.*
|
42
|
+
|
43
|
+
FROM
|
44
|
+
|
45
|
+
line_webhook_events as t1
|
46
|
+
|
47
|
+
INNER JOIN
|
48
|
+
|
49
|
+
(SELECT source_user_id, Max(line_webhook_events.id) AS id
|
50
|
+
|
51
|
+
FROM line_webhook_events
|
52
|
+
|
53
|
+
GROUP BY source_user_id) AS t2
|
54
|
+
|
55
|
+
ON t1.source_user_id = t2.source_user_id
|
56
|
+
|
57
|
+
AND t1.id = t2.id
|
58
|
+
|
59
|
+
WHERE events_type=5;
|
60
|
+
|
61
|
+
```
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
WHERE句を外に出しただけです。
|
1
書式改善
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
```
|
5
|
+
```sql
|
6
6
|
|
7
7
|
SELECT t1.*
|
8
8
|
|