mysql getting last_insert_id() in a trigger

前端 未结 1 1817
春和景丽
春和景丽 2020-12-06 05:50

It\'s my understanding that when you call last_insert_id() it goes by connections, so you\'ll get the id of the last row inserted on the same connection where last_insert_id

相关标签:
1条回答
  • 2020-12-06 06:25

    You should be able to use NEW.{id column name} to refer to the last insert id (so for example NEW.id if the auto increment column is called id.)

    0 讨论(0)
提交回复
热议问题