mysql - how to get the correct 'customerNumber'? -


this question has answer here:

i need take out correct customernumber gaves me first customer number found.

select temp.customernumber, max( temp.sum ) max (     select p.customernumber, sum( p.amount ) sum     payments p     group p.customernumber ) temp 

select temp.customernumber, max( temp.tsum ) tmax  (     select p.customernumber, sum( p.amount ) tsum      payments p      group p.customernumber ) temp group temp.customernumber 

try that.


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? -