>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
One of the possibilities
select T1.* from Codes T1 inner join (select Code, max(Rate) as MaxRate from Codes group by Code) T2
on T1.Code = T2.Code and T1.Rate = T2.MaxRate
If it's not broken, fix it until it is.
My Blog