Since your on 4.1, give this a try...
select *
from tbl as a
where a.recdate=(select max(b.recdate)
from tbl as b
where b.id=a.id and b.mount=a.mount)
Ed
-----Original Message-----
From: Duncan Hill [mailto:[EMAIL PROTECTED]
Subject: Re: Query help with grouping and latest date.
On Thursday 20 May 2004 12:49, Egor Egorov might have typed:
> Duncan Hill <[EMAIL PROTECTED]> wrote:
> > I have a table that has data that looks like:
> > +----+---------------------+-------+---------+
> >
> > | id | recdate | mount | perused |
> >
> > +----+---------------------+-------+---------+
> >
> > | 1 | 2004-05-20 10:46:12 | QUAR | 80 |
> > | 2 | 2004-05-20 11:05:11 | QUAR | 99 |
> > | 2 | 2004-05-20 11:33:27 | ROOT | 99 |
> > | 2 | 2004-05-20 11:33:34 | QUAR | 88 |
> >
> From version 4.1 subquery helps you to get result using one query.
Thanks Egor, I'll start poking at it using subqueries, as I'm running
4.1.1.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]