>Hey everyone, sorry if this is such a novice question, but I am having problems trying to pick a subset of accounts from data that looks like the following:
>
>acct# agmt date name
>123 12/10/91 john smith
>123 12/10/96 john ross
>321 01/20/91 mary kay
>321 01/20/96 mary jones
>
>I want to just select the account#'s which have the latest 'agmt date'. I have tried the following but it is not reliable when working with a large subset of data and many (sometimes 8 or more) account numbers:
>
>sele *, max(agmt_date) from xxxx group by acct#
>
>Any help is appreciated greatly!!
If you want the last date for each acct#.
SELECT * FROM xxxx GROUP BY acct# ORDER BY acct#,agmt_date DESCENDING
Mike
Michael McLain