Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Find the Last Autoincrement value

2 views
Skip to first unread message

Ramya

unread,
Nov 10, 2009, 8:17:04 AM11/10/09
to
Hi,

Can anyone tell how to get the last autoincrement value table in
mysql?

Thanks,
Ramya

Message has been deleted

toby

unread,
Nov 10, 2009, 10:08:41 AM11/10/09
to
On Nov 10, 8:17 am, Ramya <friendramya2...@gmail.com> wrote:
> Hi,
>
> Can anyone tell how to get the last autoincrement value table in
> mysql?

The id generated for the most recently inserted record on a connection
can be found by SELECT LAST_INSERT_ID().

>
> Thanks,
> Ramya

Captain Paralytic

unread,
Nov 10, 2009, 10:47:37 AM11/10/09
to
As well as Toby's answer, languages like php have functions to return
this directly.

toby

unread,
Nov 10, 2009, 12:16:26 PM11/10/09
to

D'oh! Very good point.

Captain Paralytic

unread,
Nov 10, 2009, 2:42:09 PM11/10/09
to

Yes, but the OP did ask how to get it "in mysql" and your answer was
spot on for that.

0 new messages