Is there a way to get last inserted id of a NON - auto incremented column in MySQL?

前端 未结 7 1333
别跟我提以往
别跟我提以往 2020-12-17 14:24

I know how LAST_INSERT_ID() works for auto incremented columns, but I cannot find a way to get the last id I inserted for a non auto incremented column.

Is there a

7条回答
  •  死守一世寂寞
    2020-12-17 15:12

    No.

    There is no inherent ordering of relations, no "last-inserted record". This is why the AUTO_INCREMENT field exists, after all.

    You'd have to look in logs or cache the value yourself inside your application.

提交回复
热议问题