回答編集履歴
1
追記
answer
CHANGED
@@ -12,4 +12,14 @@
|
|
12
12
|
ON t1.name = t2.name
|
13
13
|
AND t1.A_number = t2.a_number
|
14
14
|
AND case when t1.日付_1 > t1.日付_2 then t1.日付_1 else t1.日付_2 end=t2.最大日付
|
15
|
+
```
|
16
|
+
|
17
|
+
追記
|
18
|
+
--
|
19
|
+
ちょっと先走って回答になったので、訂正
|
20
|
+
```SQL
|
21
|
+
SELECT t1.*
|
22
|
+
FROM table_a as t1
|
23
|
+
where 日付_1 = (select max(日付_1) from table_a where name=t1.name and A_number=t1.A_number)
|
24
|
+
or 日付_2 = (select max(日付_2) from table_a where name=t1.name and A_number=t1.A_number)
|
15
25
|
```
|