how to do multi insert and obtain ids
Posted
by liysd
on Stack Overflow
See other posts from Stack Overflow
or by liysd
Published on 2010-05-21T14:48:32Z
Indexed on
2010/05/21
14:50 UTC
Read the original article
Hit count: 206
hi,
I want to insert some data into a table
(id PK autoincrement, val)
with use multi insert
INSERT INTO tab (val) VALUES (1), (2), (3)
Is it possible to obtain a table of last inserted ids?
I'm asking becouse I'm not sure if all will in this form: (n, n+1, n+2).
I use mysql inodb.
© Stack Overflow or respective owner