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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -