I have Donaters table:
id,name,phone,address
And Donations table:
id,donater_id,donation_amount
what I want is to get all donaters with their max donation amount like this:
id,name,donation_amount
I have tried the following query to get the result.
select a.id,a.name,max(b.donation_amount) max_d
from donaters a left join donations b on b.donater_id = a.id
groub by a.id,a.name,max_d
However, it returns duplications.