回答編集履歴
1
追記
test
CHANGED
@@ -53,3 +53,29 @@
|
|
53
53
|
|
54
54
|
|
55
55
|
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
# 追記
|
60
|
+
|
61
|
+
該当するレコードをすべてとりだすならこうしてください
|
62
|
+
|
63
|
+
```SQL
|
64
|
+
|
65
|
+
SELECT t1.* from table_a as t1
|
66
|
+
|
67
|
+
INNER JOIN (
|
68
|
+
|
69
|
+
SELECT company,max(year) as year
|
70
|
+
|
71
|
+
from table_a where value IS NOT NULL GROUP BY company
|
72
|
+
|
73
|
+
) as t2
|
74
|
+
|
75
|
+
on t1.year=t2.year and t1.company=t2.company
|
76
|
+
|
77
|
+
WHERE t1.company='A';
|
78
|
+
|
79
|
+
```
|
80
|
+
|
81
|
+
|