Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for LAST_INSERT_ID() #19831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions functions-and-operators/information-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ TABLE t1;
>
> - In the preceding example, IDs increase by 2 while MySQL would generate IDs incrementing by 1 in the same scenario. For more compatibility information, see [Auto-increment ID](/mysql-compatibility.md#auto-increment-id).

The `LAST_INSERT_ID(expr)` function can be used with an expression as argument, in which case the value is remembered for the next call to `LAST_INSERT_ID()` allowing this to be used as a MySQL compatible way of generating sequences. Note that TiDB also has support for proper [sequences](/functions-and-operators/sequence-functions.md).

### ROW_COUNT()

The `ROW_COUNT()` function returns the number of affected rows.
Expand Down
Loading