最后插入的 ID 的 PostgreSQL 函数 - PostgreSQL function for last inserted ID

问题:

In PostgreSQL, how do I get the last id inserted into a table?在 PostgreSQL 中,如何将最后一个 id 插入到表中?

In MS SQL there is SCOPE_IDENTITY().在 MS SQL 中有 SCOPE_IDENTITY()。

Please do not advise me to use something like this:请不要建议我使用这样的东西:

select max(id) from table

解决方案:

参考一: https://stackoom.com/question/CLwf
参考二: PostgreSQL function for last inserted ID
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章