atich" <[EMAIL PROTECTED]>
To: "Chris Edwards" <[EMAIL PROTECTED]>
Cc: "MySQL List" <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 2:37 PM
Subject: Re: fastest way to get last row
>
> Couldn't something like this work?
>
> SELECT id,foo,
Couldn't something like this work?
SELECT id,foo,bar FROM tbl ORDER BY id DESC LIMIT 1
Thanks,
Ryan Yagatich
,_,
\ Ryan Yagatich [EMAIL PROTECTED] \
/ Pantek Incorporated (877) LINUX-FIX /
\ http://www.pant
On Mon, Jun 09, 2003 at 02:22:56PM -0400, Chris Edwards wrote:
> Hi
>
> Does anyone have tips on the fastest way to get the last row in a table.
>
> What I have is an int as the the primary key, using auto inc.
>
> I currently do a select max(id), then run another query retrieving a row
> based
SELECT * FROM table ORDER BY id DESC LIMIT 1;
Regards,
Miek Hillyer
www.vbmysql.com
-Original Message-
From: Chris Edwards [mailto:[EMAIL PROTECTED]
Sent: Monday, June 09, 2003 12:23 PM
To: MySQL List
Subject: fastest way to get last row
Hi
Does anyone have tips on the fastest way
Hi
Does anyone have tips on the fastest way to get the last row in a table.
What I have is an int as the the primary key, using auto inc.
I currently do a select max(id), then run another query retrieving a row
based on the the max(id).
Its two queries.
Would I be able to get it all into one