I have a table in SQL Server called [Donations] that contains donations given by various people.
Its fields are:
FirstName,LastName,FullName,Description --VARCHARs
DateOrdered, --DATE
Donation --MONEY
I wish to return all the fields in the table but I only want each persons largest donation record, not all of their donations.
Say the table contained 8 records, John Doe has 5 donation records and Jane Doe has 3.
I wish to write a query that will give me the donation record for John that was the largest donation he made and the donation record for Jane that was her largest donation.
How can I write this in SQL?
Thanks very much for any help.
this assumes that fullname is your PK on this table.