Hi

Thanks!  Looks like everyone knew the exact answer.  I guess I posted too
soon, as I figured it out also.

-- 
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
[EMAIL PROTECTED]
http://www.OuterBanksInternet.com

----- Original Message ----- 
From: "Ryan Yagatich" <[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,bar FROM tbl ORDER BY id DESC LIMIT 1
>
> Thanks,
> Ryan Yagatich
>
> ,_____________________________________________________,
> \ Ryan Yagatich                     [EMAIL PROTECTED] \
> / Pantek Incorporated                  (877) LINUX-FIX /
> \ http://www.pantek.com/security        (440) 519-1802 \
> /       Are your networks secure? Are you certain?     /
> \___37AD0283C6E7B51D5C0610E5C5F103776D2C520B0B0B9E58___\
>
> On Mon, 9 Jun 2003, 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 on the the max(id).
> >
> >Its two queries.
> >
> >Would I be able to get it all into one?
> >
> >Not using mysql 4...
> >
> >Thanks.
> >
> >
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to