Hi
I've looked at Allen Brownes sub query page, but I'm still confused.
I have a table for call ProfPrem which has 3 fields:
PolRef - Unique policy ref
Profession - The Profession of the policy holder.
Ann_Premium - The annual premium
So I'd like to show the top 5 premiums per profession.
SELECT ProfPrem.Profession, ProfPrem.PolRef, ProfPrem.Ann_premiumFROM ProfPremWHERE (((ProfPrem.PolRef) In (SELECT TOP 5 PolRef FROM ProfPrem AS Dupe WHERE Dupe.PolRef = ProfPrem.PolRef ORDER BY Dupe.Ann_Premium DESC)))ORDER BY ProfPrem.Profession;