SELECT LAST_INSERT_ID()

前端 未结 6 1366
臣服心动
臣服心动 2020-12-28 11:05

Can somebody explain how works MySQL function LAST_INSERT_ID(). I\'m trying to get id of last inserted row in database, but every time get 1.

I use mybatis.

6条回答
  •  眼角桃花
    2020-12-28 11:42

    LAST_INSERT_ID()
    

    is per user and per connection.

    You can read more in MySQL doc.

提交回复
热议问题