>Hi Expert
>
>I have a Table of about 100000 records of about 3000 Codes. I want to select Code,Last Pur.Rate with Date of each code.
>
>Thnx in advance
>
>Rgds:
>Ahsan Rana
select * from Table T
where primarykey = (select TOP 1 primarykey from Table X WHERE X.Code=T.Code order by LastPurchase DESC)