回答編集履歴
1
調整
answer
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
```SQL
|
2
|
+
select min(id) from tbl
|
3
|
+
where item_id=(
|
2
|
-
select
|
4
|
+
select item_id from tbl as t1
|
3
|
-
inner join tbl as t2
|
4
|
-
|
5
|
+
where not exists (select 1 from tbl where id>t1.id)
|
5
|
-
|
6
|
+
)
|
6
|
-
```
|
7
|
+
```
|
8
|
+
※最新idも自動取得でしたね・・・
|