Re: Query select value on MAX Date

Re: Query select value on MAX Date

am 26.02.2006 00:10:51 von Neil Smth

At 08:47 25/02/2006, you wrote:
>MIME-Version: 1.0
>Content-Type: multipart/alternative;
> boundary="----_=_NextPart_001_01C63997.1A6B1B7D"
>Date: Sat, 25 Feb 2006 08:07:36 +0900
>Message-ID:
>From:
>To: <'php-db@lists.php.net'>
>Subject: FW: [PHP-DB] Query select value on MAX Date
>
>Dear All,
>
> Sorry, I wrote the wrong result.

You've posted 3x with different results so it's too confusing to work
out what you *want* to get.

However I woudl write that query like so :

SELECT MAX(Date) as NewestDate, Value
FROM table
GROUP BY Category
HAVING Date=NewestDate

HTH
Cheers - Neil

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php