This is what I use in those situations:
select * from TABLE_NAME order by ID desc limit 1;
On Fri, Sep 07, at 01:43pm, Chris Aitken ([EMAIL PROTECTED]) wrote:
> Hi all,
>
> Just quickly,
>
> Im managing to do this, but I can see that the method im using is not as
> efficient as it could be. What I want to do is this.... Make a query which
> will grab the record in a table that has the highest ID number. The ID
> field is auto incremental so what its saying is that the record with the
> highest ID field is the newest record.....
>
> Any suggestions on how I can do this efficiently ?
>
>
>
> Thanks
>
>
> Chris
>
>
> --
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: [EMAIL PROTECTED] phone: +61 2 4628 8888 fax: +61 2 4628 8890
> __-----------------------------------------__
> *** Big Brother ***
> It just shows that the dull will rule the world. And we will be watching it.
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php