标签: sql monetdb
我一直在查询我插入(SELECT "id" FROM "my_table" ORDER BY "id" DESC LIMIT 1)的给定表的最新(自动递增)ID,但我想知道是否存在更通用的方法来执行此操作,而是
SELECT "id" FROM "my_table" ORDER BY "id" DESC LIMIT 1
答案 0 :(得分:0)
获取专栏
SELECT max ("id") FROM "my_table"
获取行
Select * from "my table" where "id" in (SELECT max ("id") FROM "my_table")