回答編集履歴
1
追記
test
CHANGED
@@ -27,3 +27,23 @@
|
|
27
27
|
AND case when t1.日付_1 > t1.日付_2 then t1.日付_1 else t1.日付_2 end=t2.最大日付
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
追記
|
34
|
+
|
35
|
+
--
|
36
|
+
|
37
|
+
ちょっと先走って回答になったので、訂正
|
38
|
+
|
39
|
+
```SQL
|
40
|
+
|
41
|
+
SELECT t1.*
|
42
|
+
|
43
|
+
FROM table_a as t1
|
44
|
+
|
45
|
+
where 日付_1 = (select max(日付_1) from table_a where name=t1.name and A_number=t1.A_number)
|
46
|
+
|
47
|
+
or 日付_2 = (select max(日付_2) from table_a where name=t1.name and A_number=t1.A_number)
|
48
|
+
|
49
|
+
```
|