mysql - why does this give me the wrong customerNumber? -
i tried customer pay maximum amount. gave me maximum amount wrong customer. should do?
select temp.customernumber, max( temp.max ) sum ( select p.customernumber, p.amount max payments p group p.customernumber ) temp
using join, possibly follows:-
select * payments inner join ( select max(amount) maxamount payments ) sub1 on payments.amount = sub1.maxamount
down side of if 2 people both have same high payment both returned.
Comments
Post a Comment