RE: [PHP-DB] Query select value on MAX Date

From: Date: Fri, 24 Feb 2006 21:04:48 +0000
Subject: RE: [PHP-DB] Query select value on MAX Date
Groups: php.db 
Request: Send a blank email to php-db+get-41319@lists.php.net to get a copy of this message
Dear All, I have table like this : Id | Category | Date | Value 1 | A | 2005-02-21 | 2000 2 | A | 2004-01-21 | 3000 3 | B | 2006-01-20 | 4000 4 | B | 2005-12-11 | 5000 I want to get the value for each Category where the date is MAX. So I make the query like this : "SELECT MAX(Date), Value FROM table GROUP BY Category" But I get is : Id | Category | Date | Value 1 | A | 2005-02-21 | 2000 3 | B | 2006-01-20 | 4000 Could you help me please? Thanks & Regards, Anita

« previous php.db (#41319) next »