Re: [php] most recent row from table

From: Date: Tue, 02 Jun 2009 16:29:20 +0000
Subject: Re: [php] most recent row from table
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-293496@lists.php.net to get a copy of this message
On Tue, Jun 2, 2009 at 12:19 PM, Paul M Foster <paulf@quillandmouse.com> wrote: > On Tue, Jun 02, 2009 at 11:58:07AM -0400, Bastien Koert wrote: > >> On Tue, Jun 2, 2009 at 11:49 AM, HELP! <izoduwa@gmail.com> wrote: >> > Hi, >> > >> > how do you select the most recent row from sql table if the date are stored >> > this format  date('Y-m-d H:i:s')  e.g (2009-06-02 10:10:30) >> > >> > i have tried select top 1 from table where id = xx >> > any solution >> > -- >> > www.bemycandy.com >> > >> >> >> select top 1 from table where id = xx order by date_field desc > > What database(s) support a "TOP" clause in SELECT statements? > > Paul > > -- > Paul M. Foster Microsoft SQL Server. It's not as flexible as MySQL's LIMIT statement, though. Andrew

« previous php.general (#293496) next »