回答編集履歴
1
修正
answer
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
相関サブクエリーでIDでの最新のsale_dateに限定します。
|
2
2
|
```SQL
|
3
|
-
select
|
3
|
+
select ID, sale_date, sum(discout_price) from A as t
|
4
4
|
where sale_date=(select max(sale_date) from A where id=t.id)
|
5
|
+
group by ID, sale_date
|
5
6
|
```
|