简体   繁体   中英

Can I retrieve the last insert id in monetdb?

我一直在查询我插入的给定表的最新(自动递增)ID( SELECT "id" FROM "my_table" ORDER BY "id" DESC LIMIT 1 ),但我想知道是否存在相反,更通用的方法来做到这一点。

Get Column

SELECT max ("id") FROM "my_table"

Get Row

Select * from "my table" where "id" in (SELECT max ("id") FROM "my_table")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM