On Duplicate key Mysql - Ultimo id auto incremet

Asked

Viewed 50 times

1

How do I return the last auto id increment in this case?

insert into t1(a, b, c)
select d, e, f from t2
on duplicate key update b = e, c = f;

I’ve tried last_insert_id(), but it returns the last id of the table and not the transaction.

I wanted to get the last id in the case of Insert or the updated registry id in the case of update.

Exists as?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.