From: Martijn Tonies Date: October 29 2003 4:01pm Subject: Re: Finding information in the last record List-Archive: http://lists.mysql.com/mysql/152708 Message-Id: <04a101c39e35$f7fc2ca0$0a02a8c0@seal> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Jess, > Being real new to MySQL I am having difficulty finding information on how to > retrieve data from the last record in a database. Mind you - the "last" record doesn't have to be the last record if you're running an application with multiple users. That said, the last record in any table using a numeric PK should be the record with the highest PK value: select * from table_name order by pk_column desc limit 1 > I have tried using the SELECT LAST_INSERT_ID() statement but that only works > on a per connection basis and doesn't help all the times. > > Basically I want to goto the end of file and pull the data from a particular > field ("sku") from the last record/row. With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird & MS SQL Server. Upscene Productions http://www.upscene.com