I have this sql table:
Niin char(9)
EffectiveDate Date
Price currency
The NIIN repeates itself with different EffectiveDate and Price values like so
**NIIN EffectiveDate Price**
012345678 6/1/2011 89.00
012345678 6/1/2012 99.00
012345678 6/1/2012 99.00
123456789 5/1/2011 77.00
123456789 5/1/2012 80.00
123456789 5/1/2012 80.00
etc....
What I need to do is return the NIIN, with the Price of the Max EffectiveDate, assuming that if there are duplicate EffectiveDate values, the Price will always be the same.
Therfore from the example I supplied the query would return:
012345678 99.00
123456789 80.00
Thanks for any help.