最後插入的 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章