Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select max sum amount
Message
De
06/09/2011 11:18:30
 
 
À
06/09/2011 11:07:48
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01522791
Message ID:
01522798
Vues:
40
>>Sorry Antonio
>>
>>I updated the message to say can I have the max for each member_ref
>>
>>
>>>Can
>>>
>>>ORDER BY total DESC
>>>
>>>do the trick?
>>>
>>>>Hi
>>>>
>>>>I have
>>>>
>>>>
>>>>
>>>>select sum(amount) as [total],
>>>>		member_ref,
>>>>		description 
>>>>from payments 
>>>>where description like '%Test%' 
>>>>group by member_ref,description 
>>>>
>>>>
>>>>
>>>>how can I select out only the maximum sum amount.
>>>>
>>>>Thanks
>>>>
>>>>Nick
>
>I'm missing something here, if you select the sum(amount) for each member_ref grouped by member_ref, then isn't the sum of the total for each member_ref, therefore, the max?

Hi John

no because I also have several possible description groups.
So I want the Maximum amount amongst the description groups sums for each member.

Thanks

Nick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform