mysql - how to get the correct 'customerNumber'? -
this question has answer here:
- why give me wrong customernumber? 3 answers
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
Post a Comment