Re: fastest way to get last row

2003-06-09 Thread Chris Edwards
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,

Re: fastest way to get last row

2003-06-09 Thread Ryan Yagatich
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

Re: fastest way to get last row

2003-06-09 Thread Jeremy Zawodny
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

RE: fastest way to get last row

2003-06-09 Thread Mike Hillyer
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

fastest way to get last row

2003-06-09 Thread Chris Edwards
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