回答編集履歴

1

調整

2021/03/13 06:56

投稿

yambejp
yambejp

スコア116694

test CHANGED
@@ -1,11 +1,15 @@
1
1
  ```SQL
2
2
 
3
- select min(t1.id) from tbl as t1
3
+ select min(id) from tbl
4
4
 
5
- inner join tbl as t2
5
+ where item_id=(
6
6
 
7
- on t1.item_id=t2.item_id
7
+ select item_id from tbl as t1
8
8
 
9
- and t2.id=10010
9
+ where not exists (select 1 from tbl where id>t1.id)
10
+
11
+ )
10
12
 
11
13
  ```
14
+
15
+ ※最新idも自動取得でしたね・・・