Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 关于last_insert_id()
[TiDB Usage Environment] Poc
[TiDB Version] v7.4.0
[Encountered Issue: Phenomenon and Impact]
last_insert_id() does not display as expected:
My operations are as follows:
Shouldn’t the return value of last_insert_id() be 9?
LAST_INSERT_ID()
If no parameter is provided, LAST_INSERT_ID() returns a BIGINT UNSIGNED (64-bit) value representing the first automatically generated value that was successfully added to the column due to the most recent INSERT statement with AUTO_INCREMENT. If no row was successfully inserted, the value of LAST_INSERT_ID() remains unchanged.
Got it, thanks to the person above.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.