回答編集履歴

1

chousei

2018/11/16 00:42

投稿

yambejp
yambejp

スコア114915

test CHANGED
@@ -15,3 +15,23 @@
15
15
  ) as t3 on t1.id=t3.item_id
16
16
 
17
17
  ```
18
+
19
+ select *は無駄でしたね
20
+
21
+
22
+
23
+ ```SQL
24
+
25
+ select * from item_master as t1
26
+
27
+ inner join item_prices as t2
28
+
29
+ on t1.id=t2.item_id
30
+
31
+ and not exists(
32
+
33
+ select 1 from item_prices
34
+
35
+ where t2.item_id=item_id and t2.created_at<created_at)
36
+
37
+ ```